query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
to prevent code injection: system is a dangerous call
def raise_single_quote_error raise ArgumentError, "Single quotes are not allowed in filenames here." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def safe_system *args\n Kernel.system *args\nend", "def system=(_arg0); end", "def _unsafe_system(command)\n\n ### ###\n ### XXX - SECURITY ###\n ### ###\n\n if command =~ /(\\||\\;|\\`)/\n #raise \"Illegal character\"\n _log_error \"FATAL Illegal character in #{command}\"\n return\n end\n\n `#{command}`\n end", "def system; end", "def system; end", "def exploit\n end", "def safe_system(*cmd)\n exit 1 unless system(*cmd)\nend", "def safe_system cmd, *args\n raise ExecutionError.new($?) unless system(cmd, *args)\n end", "def sys(cmd, sensitive=[])\n sanitized = cmd.dup\n sensitive.each { |s| sanitized.gsub!(s, '...') }\n puts \"+ #{sanitized}\"\n\n system(cmd)\nend", "def exec; end", "def exec; end", "def code_like_crazy\r\n puts \"I'm crushing some code!\"\r\n end", "def system!(cmd)\n unless system(cmd)\n raise <<-SYSTEM_CALL_FAILED\nThe following command failed:\n #{cmd}\nSYSTEM_CALL_FAILED\n end\nend", "def safe; end", "def system_check(cmd)\n success = system cmd\n raise \"Error running '#{cmd}'\" unless success \nend", "def process_command_safely(val)\n process_command(val)\n rescue CommandError,\n Pry::Slop::InvalidOptionError,\n MethodSource::SourceNotFoundError => e\n Pry.last_internal_error = e\n output.puts \"Error: #{e.message}\"\n true\n end", "def system(cmd, *rest) end", "def run_as_system(command)\n Strainer.ui.debug 'Using %x'\n %x{#{command}}\n end", "def single_exploit\n end", "def calling_cry\n cry\n end", "def system_check(cmd)\n puts \"=> '#{cmd}'\"\n success = system cmd\n raise \"Error running '#{cmd}'\" unless success \nend", "def safe_system cmd, *args\n homebrew_fork_system(cmd, *args) or raise Hbc::ErrorDuringExecution.new(cmd, args)\nend", "def runSystemSafe(*cmdAndArgs)\n if cmdAndArgs.length < 1\n onError \"Empty runSystemSafe command\"\n end\n\n if !File.exists? cmdAndArgs[0] or !Pathname.new(cmdAndArgs[0]).absolute?\n # check that the command exists if it is not a full path to a file\n requireCMD cmdAndArgs[0]\n end\n\n system(*cmdAndArgs)\n $?.exitstatus\nend", "def runSystemSafe(*cmd_and_args)\n onError 'Empty runSystemSafe command' if cmd_and_args.empty?\n\n if !File.exist?(cmd_and_args[0]) || !Pathname.new(cmd_and_args[0]).absolute?\n # check that the command exists if it is not a full path to a file\n requireCMD cmd_and_args[0]\n end\n\n system(*cmd_and_args)\n $CHILD_STATUS.exitstatus\nend", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def sandbox?; end", "def sandbox?; end", "def safe_run()\n begin\n self.run()\n rescue Exception=>e\n\te_string = \"hmm, cron method excepted: #{e}\"\n\tprint e_string\n\tself.getSession().say( e_string )\n end\n end", "def safe_method(cmd, *args)\n cmd = cmd.to_sym unless cmd.is_a? Symbol\n command_line = ([cmd.to_s] + args).join ' '\n if debug_mode_enabled?\n debug \"Exec: #{command_line}\"\n return\n end\n begin\n send cmd, *args\n rescue StandardError => exception\n debug \"Command execution have failed: #{command_line}\"\n raise exception\n end\n end", "def run_cmd(cmd)\n\tend", "def sandbox; end", "def sandbox; end", "def safe_system cmd, *args\n unless Homebrew.system cmd, *args\n args = args.map{ |arg| arg.to_s.gsub \" \", \"\\\\ \" } * \" \"\n raise \"Failure while executing: #{cmd} #{args}\"\n end\nend", "def raw_api_call(sttring)\n\t\teval \"ensure_xen_session.#{string}\"\n\tend", "def system!(cmd)\n unless system(cmd)\n raise <<-SYSTEM_CALL_FAILED\n The following command failed:\n #{cmd}\n\n This could be caused by a PATH issue in the environment of Ruby.\n Your current PATH:\n #{ENV['PATH']}\nSYSTEM_CALL_FAILED\n end\n end", "def sandbox=(_arg0); end", "def sandbox=(_arg0); end", "def execute_safely(process)\n begin\n process.call()\n rescue Interrupt => err\n puts \"¡Adiós!\"\n rescue MateRuntimeError => err\n unless err.line_number.nil?\n line_number = \" en la línea #{err.line_number}\"\n end\n abort \"Error corriendo el programa: #{err.msg}. En la función #{err.function}#{line_number}\"\n end\n end", "def cmd(cmd)\n puts cmd\n system cmd\nend", "def taint() end", "def do_it(code)\n eval(code)\nrescue \n puts \"Cannot do it!\"\nend", "def cmd; end", "def remove_system_internals(text_to_process)\n code_location = File.dirname(self.code.path).gsub(\"\\\\\", '/') + '/'\n text_to_process.gsub!(\"\\\\\", '/')\n text_to_process.gsub(code_location, '')\n end", "def sys cmd\n puts cmd\n system cmd\n raise \"Running '#{cmd}' failed\" if $? != 0\nend", "def exploit\r\n\t\t# Avoid passing this as an argument for performance reasons\r\n\t\t# This is in base64 is make sure our file isn't mangled\r\n\t\t@native_payload = [generate_payload_exe].pack(\"m*\")\r\n\t\t@native_payload_name = rand_text_alpha(rand(6)+3)\r\n\t\t@jsp_name = rand_text_alpha(rand(6)+3)\r\n\t\t@outpath = \"\\\"C:/Program Files/SolarWinds/Storage Manager Server/webapps/ROOT/#{@jsp_name + '.jsp'}\\\"\"\r\n\r\n\t\tbegin\r\n\t\t\tt = framework.threads.spawn(\"reqs\", false) { inject_exec }\r\n\t\t\tprint_status(\"Serving executable on #{datastore['SRVHOST']}:#{datastore['SRVPORT']}\")\r\n\t\t\tsuper\r\n\t\tensure\r\n\t\t\tt.kill\r\n\t\tend\r\n\tend", "def sandbox(&code)\n proc {\n $SAFE = 2\n yield\n }.call\nend", "def sandbox &code\n proc {\n $SAFE = 2\n yield\n }.call\nend", "def exploit_bomb()\r\n puts \"++ We get signal. Overwriting #{TARGET_BINARY} with #{TARGET_SHELL_PATH}.\"\r\n\r\n # Overwriting with this method will always work well if binary at TARGET_SHELL_PATH\r\n # is bigger than TARGET_BINARY (ex. /bin/sh is 1068844 bytes and /bin/ps is 68432).\r\n # An alternative method is running diskutil again to set the rogue permissions.\r\n over = File.new(TARGET_BINARY, \"w\")\r\n over.write(File.read(TARGET_SHELL_PATH))\r\n over.close\r\n \r\n unless FileTest.setuid?(TARGET_BINARY)\r\n fork do\r\n FileUtils.rm_f TARGET_BINARY\r\n FileUtils.cp TARGET_SHELL_PATH, TARGET_BINARY\r\n exec \"#{DISKUTIL_PATH} repairPermissions /\"\r\n end\r\n Process.wait\r\n end\r\n \r\n puts \"++ Done. Happy ruuting.\"\r\nend", "def notadmin\n\tprint_error(\"You need admin privs to run this!\")\n\tprint_error(\"Try using 'getsystem' or one of the many escalation scripts and try again.......\")\n\traise Rex::Script::Completed\nend", "def system_call(call)\n system_caller.execute(call)\n end", "def original_run_command=(_arg0); end", "def isok(input)\n # make sure that the input does not contain system ''\n ! input.downcase.include? 'system'\n end", "def execute(command)\n system \"#{command}\" # rubocop:disable UnneededInterpolation\nend", "def run_cmd(cmd)\n puts blue(cmd)\n raise unless system cmd\n end", "def sh(command)\n puts command\n system command unless dry_run\nend", "def is_system?(code)\n return code.is_a?(Array) && (code[0] == :command) &&\n (code[1][1] == \"system\")\n end", "def full_sanitizer=(_arg0); end", "def full_sanitizer=(_arg0); end", "def full_sanitizer=(_arg0); end", "def original_run_command; end", "def whiny=(_arg0); end", "def stupid_program\n puts \"HI I AM A STUPID PROGRAM BECAUSE I WRITE TO STDOUT LOL\" # always writes to $stdout\nend", "def eval script\n # native function. this stub is for documenting only\n end", "def do_execute\n raise StandardError, \"Not implemented!\"\n end", "def execute!; end", "def shell_api=(_arg0); end", "def unquote\n\t\teach { |e| Concatenative::System.process e }\n\tend", "def program; end", "def stub_system_calls\n Kernel.stubs(:system).returns(true)\n end", "def invalid_command\n puts \"Please enter a valid command\"\n #invalid_command\n # code invalid_command here\nend", "def run(cmd)\n puts cmd\n system cmd\nend", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def code; end", "def unknown_command(method, line)\n\n\t\t[method, method+\".exe\"].each do |cmd|\n\t\t\tif (command_passthru == true and Rex::FileUtils.find_full_path(cmd))\n\n\t\t\t\tprint_status(\"exec: #{line}\")\n\t\t\t\tprint_line('')\n\n\t\t\t\tself.busy = true\n\t\t\t\tbegin\n\t\t\t\t\tio = ::IO.popen(line, \"r\")\n\t\t\t\t\tio.each_line do |data|\n\t\t\t\t\t\tprint(data)\n\t\t\t\t\tend\n\t\t\t\t\tio.close\n\t\t\t\trescue ::Errno::EACCES, ::Errno::ENOENT\n\t\t\t\t\tprint_error(\"Permission denied exec: #{line}\")\n\t\t\t\tend\n\t\t\t\tself.busy = false\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\n\t\tsuper\n\tend", "def normaldo *args\n Kitchenplan::Log.info(*args)\n raise RuntimeError,\"'#{args}' returned non-zero\" unless system(*args)\n end", "def smart_program(io)\n io.puts \"Why hello there you much more intelligent thing!\"\nend", "def run_cmd(input); end", "def whiny; end", "def run_as_system(&block)\n run_command false, &block\n end", "def noSecret()\r\n puts \"I won’t tell you our secret\"\r\n end", "def executable_real?() end", "def system_puts(cmd)\n puts cmd\n system cmd\nend", "def get_system(code)\n return code[2][1][0][1][1][1]\n end", "def process; raise CommandError, \"command '#{command_name}' not implemented\" end", "def code=(_arg0); end", "def code=(_arg0); end", "def script=(_arg0); end", "def run_warned; end", "def execute(command)\r\n system \"#{command}\"\r\nend", "def ibu; end", "def hidden_apis=(_arg0); end", "def ygg_attacker() ; return nil ; end", "def always_run=(_arg0); end", "def handle_post_mortem; end", "def bang!\n \"bang!ed method\"\n end", "def safe=(_arg0); end" ]
[ "0.7231649", "0.6908195", "0.6856311", "0.68365335", "0.68365335", "0.66729546", "0.634052", "0.6214964", "0.62003624", "0.61936694", "0.61936694", "0.5998577", "0.5985371", "0.59819937", "0.5947401", "0.5928928", "0.59255475", "0.58995926", "0.5882401", "0.5874585", "0.5869464", "0.58678836", "0.5858838", "0.5827207", "0.5821893", "0.58073014", "0.58073014", "0.5803262", "0.5766485", "0.57321405", "0.57082653", "0.57082653", "0.5691663", "0.56863254", "0.5679757", "0.5670156", "0.5670156", "0.5670153", "0.566269", "0.5655436", "0.56527597", "0.56473106", "0.5646064", "0.56412464", "0.5613751", "0.5599473", "0.5593731", "0.5584805", "0.5573497", "0.55573493", "0.5551138", "0.55496913", "0.554241", "0.5533371", "0.5527089", "0.55266935", "0.5515544", "0.5515544", "0.5515544", "0.55148506", "0.550871", "0.5500106", "0.54960626", "0.54919815", "0.5485551", "0.5480826", "0.5480668", "0.5478889", "0.5478236", "0.5477655", "0.546964", "0.54612964", "0.54612964", "0.54612964", "0.54612964", "0.54612964", "0.54612964", "0.54612964", "0.5457389", "0.54520607", "0.5446627", "0.5441449", "0.5429061", "0.54289967", "0.54206085", "0.5414362", "0.54120237", "0.54028285", "0.53979397", "0.53933585", "0.53933585", "0.53806466", "0.5380613", "0.5366158", "0.53583694", "0.5355097", "0.5354884", "0.53477603", "0.53401446", "0.532437", "0.53239304" ]
0.0
-1
We go linear, and go through the array and create an array of zero indexes. Then go through the array, and swap out with each value that is not a zero.
def move_zeros_left_failure(array) zero_indexes = Array.new array.each_with_index do |value, index| if value == 0 zero_indexes << index end end zeros_cursor = 0 zero_indexes.each do |index| #This does not work, because we're swapping.. NOT maintaining order. #If this index is not in a place that will eventually be a zero. unless index < zero_indexes.size - 1 tmp = array[index] array[index] = array[zeros_cursor] array[zeros_cursor] = 0 zeros_cursor += 1 end end return array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def zero_ord_arr(arr)\n z = 0\n i = 1\n while i < arr.length\n if arr[z] != 0 && arr[i] == 0\n z = i\n end\n if arr[z] == 0 && arr[i] != 0\n arr[z], arr[i] = arr[i], arr[z]\n z += 1\n end\n i += 1\n end\n arr\nend", "def move_zeroes(nums)\n count = nums.select { |i| i.zero? }.count\n\n new = []\n nums.each do |value|\n if value != 0\n new.push(value)\n end\n end\n\n count.times { new.push(0) }\n\n nums.each_with_index do |value, index|\n nums[index] = new[index]\n end\n\n nums\nend", "def move_zeros(array)\n count = 0\n index = 0\n array.each do |el|\n if el == 0\n count += 1\n else\n array[index] = el\n index += 1\n end\n end\n (index...array.length).each do |i|\n array[i] = 0\n end\n\n array\nend", "def moves_zeros(array)\n i = 0\n count = 0\n new_array = []\n while i < array.length\n if array[i] != 0\n new_array << array[i]\n else\n count += 1\n end\n i += 1\n end\n count.times { new_array << 0}\n new_array\nend", "def move_zeros(array)\n zero_count = 0\n # O(n)\n array.each do |num|\n\n zero_count += 1 if num == 0\n end\n\n # O(n)\n array = array.select { |num| num != 0 }\n \n # O(1)\n zero_count.times do\n array += [0]\n end\n\n array\nend", "def move_zeroes(nums)\n len = nums.length\n count = 0\n for i in 0...len\n if nums[i] != 0\n nums[count] = nums[i]\n count += 1\n end\n end\n# # Loop from count to len-1 and fill it with zeros \n while count < len\n nums[count] = 0\n count += 1\n end\n return nums\nend", "def move_zeros(array)\n current_index = 0\n num_zeros = 0\n\n while current_index < (array.length - num_zeros)\n current_value = array[current_index]\n\n if current_value != 0\n current_index += 1\n next\n end\n\n back = array.length - 1 - num_zeros\n array[current_index], array[back] =\n array[back], array[current_index]\n num_zeros += 1\n\n # we can't add one to current_index since `back` may have contained a zero and we don't know it\n end\n\n array\nend", "def move_zeros(array)\n current_index = 0\n num_zeros = 0\n\n while current_index < (array.length - num_zeros)\n current_value = array[current_index]\n\n if current_value != 0\n current_index += 1\n next\n end\n\n back = array.length - 1 - num_zeros\n array[current_index], array[back] =\n array[back], array[current_index]\n num_zeros += 1\n\n # we can't add one to current_index since `back` may have\n # contained a zero and we don't know it.\n end\n\n # Return the array\n array\nend", "def move_zeroes(nums)\n j = 0 \n for i in 0..nums.length - 1 do \n if nums[i] != 0 \n nums[j],nums[i] = nums[i],nums[j] \n j += 1\n end \n end\n return nums\nend", "def move_zeroes(nums)\n a = 0\n r = 1\n\n while r < nums.length\n if nums[a] == 0\n if nums[r] != 0\n nums[a], nums[r] = nums[r], nums[a]\n else\n r += 1\n next\n end\n end\n\n a += 1\n r += 1\n end\n\n return nums\nend", "def moveZeroes(nums)\n slow = fast = 0\n while fast<nums.size do\n if not nums[slow]==0 then\n slow += 1\n elsif nums[fast]!=0 then\n nums[slow] ^= nums[fast]\n nums[fast] ^= nums[slow]\n nums[slow] ^= nums[fast]\n slow += 1\n end\n fast += 1\n end\n nums\nend", "def matrix_convert_to_0(matrix)\n zeros_array = []\n\n matrix.each.with_index do |row, i|\n # print \"before #{row} \\n\"\n row.each.with_index do |num, index|\n if num == 0\n zeros_array << index\n matrix[i] = Array.new(row.length, 0)\n\n end\n\n end\n # print \"after #{row} \\n\"\n end\n zeros_array.each do |ele|\n matrix.each do |row|\n row[ele] = 0\n\n end\n end\n return matrix\nend", "def move_zeroes(nums)\n zeros_index = []\n nums.each_with_index do |num, index|\n if num == 0\n p index\n zeros_index.push(index)\n end\n end\n nums.delete_if.with_index { |_, index| zeros_index.include? index }\n zeros_index.length.times do\n nums.push(0)\n end\n nums\nend", "def move_zeroes(nums)\n position = 0\n 0.upto(nums.length - 1) do |i|\n if nums[i] != 0\n nums[i], nums[position] = nums[position], nums[i]\n position += 1\n end\n end\nend", "def move_zeroes(nums)\n z = find_zero(nums, 0)\n i = z+1\n\n while i < nums.length\n if nums[i] != 0\n nums[z] = nums[i]\n nums[i] = 0\n z = find_zero(nums, z)\n end\n i += 1\n end\n\n nums\nend", "def zero_matrix2(matrix)\n (0...matrix.length).each do |row|\n (0...matrix[0].length).each do |col|\n if matrix[row][col] == 0\n matrix[0][col] = 0\n matrix[row][0] = 0\n end\n end\n end\n\n (1...matrix.length).each do |row|\n (1...matrix[0].length).each do |col|\n matrix[row][col] = 0 if matrix[0][col] == 0 || matrix[row][0] == 0\n end\n end\n\n matrix\nend", "def move_zeroes(nums)\n\n last_non_zero = -1\n\n # iterates through list once\n nums.length.times do |current|\n if nums[current] != 0\n last_non_zero += 1\n nums[current], nums[last_non_zero] = nums[last_non_zero], nums[current]\n end\n end\n\n nil\nend", "def move_zeroes(nums)\n zeros = nums.count(0)\n nums.delete(0)\n zeros.times { nums << 0 }\n nums\nend", "def matrix_convert_to_0(matrix)\n matrix.each do |row|\n index = 0\n row.each do |element|\n if element == 0\n row.length.times do |i|\n row[i] = 0\n end\n matrix.length.times do |i|\n matrix[i][index] = 0\n end\n end\n\n index += 1\n end\n end\nend", "def move_zeros(array)\n\nend", "def map_to_negativize(array)\n final_array = []\n counter = 0 \n while counter < array.size do \n final_array.push(array[counter] * -1)\n counter += 1\n end\n final_array\nend", "def move_zeroes(nums)\n current_idx = 0\n zeroes = []\n while current_idx < nums.length\n if nums[current_idx] == 0\n nums.slice!(current_idx, 1)\n zeroes << 0\n else\n current_idx += 1\n end\n end\n\n nums.concat(zeroes)\nend", "def move_zeroes(array)\n num_of_zeros = array.count(0) # This step of assigning array.count(0) to a variable is necessary to reduce the time taken to evaluate the kata because LeetCode compiler doesn't have to evaluate array.count(0) again inside the loop; it can simply use the variable that is stored in memory. This is important because LeetCode imposes a time constraint on every kata.\n (0...array.count).each { |position| # (0..array.count-1) does the same as (0...array.count). triple dots for range operator means excluding the end value; double dots include the end value.\n break if position == array.count - num_of_zeros # Because there're 2 zeroes, if all of them have been deleted and pushed to the end of the array, then the 1st zero will be at position number 3(index starts at 0). Therefore, once we reached that position, we can stop and break from the loop.\n while array[position] == 0\n array.delete_at(position) # delete the number at that position from the array. delete_at() only accepts an index as argument.\n array.push(0) # push to the end of the array.\n end\n }\n return array\nend", "def shift_values(arr)\n for i in 0...arr.length-1\n arr[i] = arr[i + 1]\n end\n arr[arr.length - 1] = 0\n return arr\nend", "def matrix_convert_to_0(matrix)\n\n rows = matrix.length\n columns = matrix[0].length\n track_zeros = []\n\n rows.times do |row|\n columns.times do |column|\n if matrix[row][column] == 0\n track_zeros << [row, column]\n end\n end\n end\n\n track_zeros.length.times do |index|\n columns.times do |column|\n matrix[track_zeros[index][0]][column] = 0\n end\n\n rows.times do |row|\n matrix[row][track_zeros[index][1]] = 0\n end\n end\n\nend", "def map_to_no_change(source_array)\n array = []\n index = 0 \n \n while index < source_array.size do \n array.push(source_array[index])\n index += 1 \n end\n return array\nend", "def map_to_no_change(source_array)\n \n i = 0\n new_array = []\n \n while i < source_array.length do\n new_array << source_array[i]\n \n i += 1\n end\n \n new_array\nend", "def map_to_negativize(source_array)\n temp = []\n i = 0\n while i < source_array.length do\n temp[i] = -source_array[i]\n i += 1\n end\n return temp\nend", "def example2(arr)\n results = []\n # arr.reverse.each do |ele|\n # ele == 0 ? results << ele : results.unshift(ele)\n # end\n\n arr.each_with_index do |el, idx|\n if el == 0\n results << el\n arr.delete_at(idx)\n end\n end\n arr.concat(results)\nend", "def map_to_negativize(source_array)\n \n i = 0\n new_array = []\n \n while i < source_array.length do\n new_array_value = source_array[i] * -1\n new_array << new_array_value\n \n i += 1\n end\n \n new_array\nend", "def matrix_convert_to_0(matrix)\n\n# arrays to store the values of the indices in the matrix that have zeros\n rows = []\n cols = []\n\n matrix.length.times do |row_index|\n matrix[0].length.times do |col_index|\n if matrix[row_index][col_index] == 0\n rows << row_index\n cols << col_index\n end\n end\n end\n\n rows.each do |r_index|\n matrix[0].length.times do |c_index|\n matrix[r_index][c_index] = 0\n end\n end\n\n cols.each do |c_index|\n matrix.length.times do |r_index|\n matrix[r_index][c_index] = 0\n end\n end\n\n return matrix\n\nend", "def zero_matrix( matrix )\n rows_with_zero = []\n columns_with_zero = []\n \n matrix.each_with_index do | row, row_number |\n row.each_with_index do | val, column_number |\n if val == 0\n rows_with_zero << row_number unless rows_with_zero.include? row_number\n columns_with_zero << column_number unless columns_with_zero.include? column_number\n end\n end\n end\n \n rows_with_zero.each do | row_index |\n row = matrix[ row_index ]\n \n row.each_with_index do | _val, index |\n row[ index ] = 0\n end\n end\n \n matrix.each do | row |\n columns_with_zero.each do | column_index |\n row[ column_index ] = 0\n end\n end\n \n matrix.each do | row |\n row.each do | val |\n print \"#{ val } \"\n end\n \n puts \"\"\n end\n \nend", "def invert(list)\n for i in 0..list.length-1\n list[i] *= -1 unless list[i] == 0\n end\n list\nend", "def move_zeroes(nums)\n ndx = 0\n times = 0\n\n while times < nums.size\n if nums[ndx] == 0\n nums.delete_at(ndx)\n nums << 0\n else\n ndx += 1\n end\n\n times += 1\n end\n\n nil\nend", "def matrix_convert_to_zero(matrix)\n rows = matrix.length\n cols = matrix[0].length\n row_zero = []\n col_zero = []\n\n rows.times do |row|\n cols.times do |col|\n if matrix[row][col] == 0\n row_zero << row\n col_zero << col\n end\n end\n end\n\n row_zero.uniq.each do |row|\n cols.times do |col|\n matrix[row][col] = 0\n end\n end\n\n col_zero.uniq.each do |col|\n rows.times do |row|\n matrix[row][col] = 0\n end\n end\n\n return matrix\nend", "def matrix_convert_to_0(matrix)\n\n rows = matrix.length\n columns = matrix[0].length\n\n row_array = []\n column_array = []\n\n r = 0\n while r < rows do\n\n c = 0\n while c < columns do\n\n if matrix[r][c] == 0\n row_array << r\n column_array << c\n end\n\n c += 1\n end\n\n r += 1\n end\n\n row_array.each do |r|\n columns.times do |c|\n matrix[r][c] = 0\n end\n end\n\n\n column_array.each do |c|\n rows.times do |r|\n matrix[r][c] = 0\n end\n end\n\n\n return matrix\nend", "def move_zeros(nums)\n return nums if nums.length == 1\n\n i = 0\n j = 0\n while j < nums.length\n if nums[i] == 0\n\n until nums[j] != 0 || j >= nums.length -1\n j += 1\n end\n\n if nums[j] != 0\n temp = nums[i]\n nums[i] = nums[j]\n nums[j] = temp\n else\n return nums\n end\n end\n\n i += 1\n j += 1\n end\n return nums\nend", "def matrix_convert_to_0(matrix)\n rows = matrix.length\n columns = matrix[0].length\n\n row_zero = []\n column_zero = []\n rows.times do |row|\n columns.times do |column|\n if matrix[row][column] == 0\n row_zero << row\n column_zero << column\n end\n end\n end\n\n row_zero.each do |r|\n columns.times do |c|\n matrix[r][c] = 0\n end\n end\n\n column_zero.each do |c|\n rows.times do |r|\n matrix[r][c] = 0\n end\n end\n print matrix\nend", "def change_resistant_for_each_element(array)\n copy =Array.new(array)\n i=0\n while i<copy.length\n copy[i]=array[i]\n i +=1\n end\n copy\nend", "def map_to_negativize(source_array)\n new_array = []\n negativize = 0 \n i = 0\n while i < source_array.length do \n negativize = source_array[i] * - 1 \n new_array.push(negativize)\n i += 1 \n end \n return new_array \nend", "def set_zero(matrix)\n array = []\n cols = matrix[0].size\n matrix.size.times do \n array << Array.new(cols)\n end\n\n matrix.each_with_index do |rows_array, row_index|\n catch :outerrow do\n rows_array.each_with_index do |element, col_index|\n if element == 0\n 0.upto(cols - 1) do |col|\n array[row_index][col] = 0\n end\n\n 0.upto(cols - 1) do |row|\n array[row][col_index] = 0\n end\n throw :outerrow\n else\n if array[row_index][col_index] != 0\n array[row_index][col_index] = element\n end\n end\n end\n end\n end\n\n array\nend", "def matrix_convert_to_0(matrix)\n current_matrix = 0\n current_loc = 0\n delta = 0\n\n while current_matrix <= (matrix.length - 1) do\n while current_loc <= matrix[current_matrix].length - 1 do\n if matrix[current_matrix][current_loc] == 0\n delta = current_loc\n delta_count = 0\n while delta_count <= matrix[current_matrix].length - 1 do\n matrix[current_matrix][delta_count] = 0\n delta_count += 1\n end\n delta_count = 0\n while delta_count <= matrix.length - 1 do\n matrix[delta_count][delta] = 0\n delta_count += 1\n end\n current_loc += 1\n else\n current_loc += 1\n end\n end\n current_matrix += 1\n current_loc = 0\n end\n\n return matrix\nend", "def expand!(original)\n from = original.size\n original.map! {|row|\n row.unshift 0\n row << 0\n }\n original.unshift(Array.new(from+2) {0})\n original << Array.new(from+2) {0}\nend", "def matrix_convert_to_0(matrix)\n count_row = matrix.length\n count_column = matrix[0].length\n\n h_row = Array.new(count_row)\n h_column = Array.new(count_column)\n\n count_column.times do |j|\n count_row.times do |i|\n if matrix[i][j] == 0\n if !h_row[i]\n h_row[i] = 0\n end\n if !h_column[j]\n h_column[j] = 0\n end\n end\n end\n end\n\n count_row.times do |i|\n if h_row[i] == 0\n count_column.times do |j|\n matrix[i][j] = 0\n end\n end\n end\n\n count_column.times do |j|\n if h_column[j] == 0\n count_row.times do |i|\n matrix[i][j] = 0\n end\n end\n end\nend", "def matrix_convert_to_0(matrix)\n\n columns = matrix[0].length #number of columns\n rows = matrix.length #number of rows\n\n to_be_zeroed = []\n\n rows.times do |row|\n columns.times do |column|\n if matrix[row][column] == 0\n to_be_zeroed << [row, column]\n end\n end\n end\n\n to_be_zeroed.each do |r, c|\n columns.times do |column|\n matrix[r][column] = 0\n end\n\n rows.times do |row|\n matrix[row][c] = 0\n end\n end\n return matrix\nend", "def basic_10 (array_iterate)\n array_iterate.collect! { |n| n < 0 ? n = 0 : n }\n return array_iterate\nend", "def matrix_convert_to_0(matrix)\n\n rows = matrix.length\n columns = matrix[0].length\n\n\n zeros = []\n rows.times do |row|\n columns.times do |column|\n if matrix[row][column] == 0\n zeros << {:row => row, :col => column}\n break\n end\n end\n end\n\n zeros.each do |zero_locations|\n rows.times do |row|\n matrix[row][zero_locations[:col]] = 0\n end\n\n columns.times do |column|\n matrix[zero_locations[:row]][column] = 0\n end\n end\n\n\nend", "def matrix_convert_to_0(matrix)\n # store coordinates of the 0s here like: [[r1, c1], [r2,c2]]\n targets = []\n\n matrix.length.times do |row|\n matrix[row].each_with_index do |value, col|\n if value == 0\n coordinate = [row, col]\n targets << coordinate\n end\n end\n end\n\n # do we have any 0s?\n if targets[0]\n targets.each do |coordinate|\n row = coordinate[0]\n col = coordinate[1]\n\n # zero out the row\n matrix[row].length.times do |each_col|\n matrix[row][each_col] = 0\n end\n\n # zero out the column\n matrix.length.times do |each_row|\n matrix[each_row][col] = 0\n end\n end\n end\n return matrix\nend", "def reverse_array(array)\n i = array.length - 1\n until i < array.length / 2\n replaced_value = array[i]\n array[i] = array[array.length - 1 - i]\n array[array.length - 1 - i] = replaced_value\n i -= 1\n end\n return array\nend", "def blank_matrix(matrix)\n matrix.map do |element_array|\n element_array.map {|element| element = 1 ? element = 0 : element = 0 }\n end\n end", "def set_zeroes(matrix)\n row = Array.new(matrix.length, false)\n col = Array.new(matrix[0].length, false)\n \n (0...matrix.length).each do |i|\n (0...matrix[0].length).each do |j|\n if matrix[i][j] == 0\n row[i] = true\n col[j] = true\n end\n end\n end\n (0...matrix.length).each do |i|\n (0...matrix[0].length).each do |j|\n if row[i] || col[j]\n matrix[i][j] = 0\n end\n end\n end\n matrix\nend", "def two_d_translate(arr)\n one_d_arr = []\n arr.each do | outer |\n outer.each.with_index do | inner, i |\n if i == 0\n outer[1].times do\n one_d_arr << inner\n end\n end\n end\n end\n return one_d_arr\nend", "def light_switcher(array, inc)\n counter = 0\n\n while counter < array.length\n array[counter] = !array[counter] if (counter + 1) % inc == 0\n counter += 1\n end\n\n array\nend", "def array_transform(array)\n\tb = []\n\tarray.each_index do |i|\n\t\tb.push(array[i]+array[i-1])\tif i > 0\n\tend\n\treturn b.unshift(1).push(1)\nend", "def zero()\n\treturn([0,0,0,0,0,0,0,0,0])\nend", "def matrix_convert_to_0(matrix)\n (matrix.length).times do |i| #number of rows times do runs 3 times\n (matrix[i].length).times do |j| #number of columns this runs 4 times\n if matrix[i][j] == 0 #if something in this row/column is 0\n row = i\n column = j #select the column\n (matrix[row].length).times do |j| #change the whole row to 0\n matrix[row][j] = 0\n end\n (matrix.length).times do |i|\n matrix[i][column] = 0\n end\n end\n end\n end\n return matrix\nend", "def zero_matrix(matrix)\n n_range = 0..(matrix.length - 1)\n m_range = 0..(matrix[0].length - 1)\n zero_indexes = Array.new()\n\n n_range.each do |i|\n m_range.each do |j|\n if(matrix[i][j] == 0)\n zero_indexes.push([i,j])\n end\n end\n end\n\n ij = zero_indexes.transpose\n\n matrix = set_zero(matrix, ij[0], m_range)\n set_zero(matrix, n_range, ij[1])\n end", "def matrixZero m\n rows = []\n cols = []\n\n (0..m.length-1).each { |row|\n (0..m[0].length-1).each { |col|\n if m[row][col] == 0 \n rows.push(row) unless rows.include?(m[row][col])\n cols.push(col) unless cols.include?(m[row][col])\n end\n }\n }\n\n (0..m.length-1).each { |row| \n (0..m[0].length-1).each { |col| \n if rows.include?(row) or cols.include?(col) \n m[row][col] = 0\n end\n }\n }\n m\nend", "def matrix_convert_to_0(matrix)\n\n\n zero_column = false\n zero_column_index = 0\n\n zero_row_index = []\n\n matrix.each_with_index do |row, idex|\n matrix[row].each_with_index do |column, index|\n if row == 0\n zero_row_index = 0\n end\n end\n end\n\n # while row_i < matrix.length\n #\n # column_i = 0\n # while column_i < matrix[row_i].length\n #\n # if matrix[row_i][column_i] == 0\n # matrix[row_i].each { |num| num = 0 }\n #\n # zero_column = column_i\n # zero_column = true\n #\n # end\n # column_i += 1\n # end\n #\n # if zero_column\n # matrix.each do |row|\n # row[zero_column_index] = 0\n # end\n # end\n #\n # row_i += 1\n # end\n\n\n return matrix\nend", "def reverse_array(array)\n flipped = []\n array.each{ |el| flipped.unshift(el) }\n flipped\nend", "def shift_val(arr)\n for i in 0..arr.length - 2\n arr[i] = arr[i+1]\n end\n arr[-1] = 0\n return arr\nend", "def switchPairs(input)\n # This should work for both even and odd length arrays. In an odd length array, the last index is even, so I've restricted the if statement to only those indicies who are less than one minus the index length. For instance, if input is an array of length 5, the last index is 4, and there's nothing after it to switch it with, so I don't want to transform it. But for an input whose length is 6, the last index is 5. So the last n that is even is 4, and there is something at index 5 to switch with.\n input.length.times do |n|\n if n % 2 == 0 && n < input.length - 1\n placeholder = input[n]\n input[n] = input[n + 1]\n input[n + 1] = placeholder\n end\n end\n return input\nend", "def matrix_convert_to_0(matrix)\n # raise NotImplementedError\n\n # for every row and every el in that row look for 0s and save them in a list\n zero_column = [] #holds the [column] for the zero\n zero_row = []\n\n matrix.length.times do |row_index| #for the number of rows in the matrix\n matrix[row_index].length.times do |column_index| #for the number of columns in the matrix\n if matrix[row_index][column_index] == 0 #when there is a zero\n zero_column << column_index #store column coordinates\n zero_row << row_index #store row coordinates\n end\n end\n end\n\n #now convert items in specified rows and columns into zeros\n #for the number of rows in the array\n\n # ======can helper method below =====\n matrix.length.times do |row_index|\n zero_row.length.times do |zero_r_i|\n if row_index == zero_row[zero_r_i] #if the row index matches the zero row index\n matrix[row_index].length.times do |column_index| #go through each item in the column of that row\n matrix[row_index][column_index] *= 0 #convert to zero\n end\n end\n end\n end\n\n matrix.length.times do |row_index| #for each row\n zero_column.length.times do |zero_c_i|\n matrix[row_index].length.times do |column_index| #for each column in row\n if column_index == zero_column[zero_c_i] #if column index is equal to column index in col arr\n matrix[row_index][column_index] *= 0 #convert to zero\n end\n end\n end\n end\n\n #if the row index matches an index in the row array\n #go through all columns in that row and convert all elements to zero\n\n return matrix\n\nend", "def rotate_array(array)\n array.values_at(1..-1, 0)\nend", "def rotate_array(arr, num)\n num.abs.times do |i|\n if num < 0\n ele = arr.shift\n arr.push(ele)\n else\n ele = arr.pop \n arr.unshift(ele)\n end\n end\n arr\nend", "def reverse!(array)\n iteration = array.length / 2\n iteration.times do |index|\n array[index], array[-index - 1] = array[-index - 1], array[index]\n end\n array\nend", "def flip\n arr = Array.new(self.length)\n (0..self.length / 2).each do |index|\n arr[index] = self[self.length - 1 - index]\n arr[self.length - 1 - index] = self[index]\n end\n arr\n end", "def backwards!(array)\n duplicate = array.clone\n counter = 0\n loop do\n break if duplicate.empty? # counter == array.length\n\n array[counter]= duplicate.pop\n counter += 1\n end\n array\nend", "def reset_memory\n i = 0\n for value in @original_values\n @input_values[i] = @original_values[i]\n i = i + 1\n end\nend", "def invert_array\n a = Array.new(length)\n each.with_index do |x, i| a[x] = i end\n a\n end", "def matrix_convert_to_zero(matrix)\n # Check for edge cases\n return if (matrix == nil || matrix == [])\n\n # Determine length of rows and columns\n rows = matrix.length\n columns = matrix[0].length\n\n row_zero_zeroes = false\n # Does Row 0 have zeros?\n columns.times do |col|\n if matrix[0][col] == 0\n row_zero_zeroes = true\n end\n end\n\n column_zero_zeroes = false\n # Does Column 0 have zeros?\n rows.times do |row|\n if matrix[row][0] == 0\n column_zero_zeroes = true\n end\n end\n\n # Check (Rows 1 - n) and (Cols 1 - n)\n # Track found zeros through Row 0 and Col 0\n # (by changing corresponding element into 0)\n\n (rows - 1).times do |row|\n (columns - 1).times do |col|\n if matrix[row + 1][col + 1] == 0\n matrix[0][col + 1] = 0\n matrix[row + 1][0] = 0\n end\n end\n end\n\n # Look at an element inside matrix\n # Check corresponding element inside row 0 or col 0\n # Are either 0? If so, change targeted element to 0\n\n (rows - 1).times do |row|\n (columns - 1).times do |col|\n if matrix[0][col + 1] == 0 || matrix[row + 1][0] == 0\n matrix[row + 1][col + 1] = 0\n end\n end\n end\n\n # IF Row 0 has zeros: Populate with 0\n if row_zero_zeroes\n columns.times do |col|\n matrix[0][col] = 0\n end\n end\n\n # IF Col 0 has zeros: Populate with 0\n if column_zero_zeroes\n rows.times do |row|\n matrix[row][0] = 0\n end\n end\n\n return matrix\nend", "def reverse!(arr)\n arr.size.times do |n|\n arr.unshift(arr.delete_at(n))\n end\n arr\nend", "def reversal(array)\n array = array.map{|element| element} #creates a copy of array, remove to have same object_id's\n left_index = 0\n right_index = -1\n \n while left_index < array.size / 2\n array[left_index], array[right_index] = array[right_index], array[left_index]\n left_index += 1\n right_index -=1\n end\n\n array\nend", "def reverse!(arr)\n (arr.length/2).times do |index|\n reverse_index = (index + 1) * -1\n arr[index], arr[reverse_index] = arr[reverse_index], arr[index]\n end\n arr\nend", "def reverse_array(i)\r\n i.reverse!\r\nend", "def map_to_negativize(array)\n new_array = array.map{|n| n*-1}\n return new_array\nend", "def matrix_convert_to_zero(matrix)\n rows = matrix.length\n cols = matrix[0].length\n\n rows.times do |row|\n cols.times do |col|\n matrix[row][col] = \"x\" if matrix[row][col] == 0\n end\n end\n\n rows.times do |row|\n cols.times do |col|\n if matrix[row][col] == \"x\"\n cols.times do |i|\n matrix[row][i] = 0 if matrix[row][i] != \"x\"\n end\n\n rows.times do |i|\n matrix[i][col] = 0 if matrix[i][col] != \"x\"\n end\n\n matrix[row][col] = 0\n end\n end\n end\n\n return matrix\nend", "def swap_elements_from_to(array,a,b)\n array[a] = array[a]^array[b]\n array[b] = array[b]^array[a]\n array[a] = array[a]^array[b]\nend", "def array_init(width)\r\n height = 2 ** width # ** used for exponential\r\n array = Array.new(height){Array.new(width + 4)} # plus 4 to account for table values\r\n array.each{|x| x.fill(0)} # initialize all values to 0\r\nend", "def rotate_array(array)\n result = []\n array.each_with_index do |value, index|\n result.push(value) if index > 0\n end\n result.push(array[0])\n result\nend", "def map_to_no_change(array)\n return array\nend", "def reverse(array)\n array.inject([]) { |memo, current| [current] + memo }\nend", "def reverse!(array)\r\n arr_copy = array.select {|x| x }\r\n first = 0\r\n last = -1\r\n loop do\r\n break if first >= array.size\r\n array[first] = arr_copy[last]\r\n first += 1\r\n last -= 1\r\n end\r\n array\r\nend", "def reverse!(array)\n copy = array.clone\n index = -1\n\n copy.each do |element|\n array[index] = element\n index -= 1\n end\n\n array\nend", "def matrix_convert_to_0(matrix)\n columns = {}\n row_count = 0\n zero_count = 0\n\n matrix.each_with_index do |row, r|\n row.each_with_index do |cell, c|\n\n #look at a row if you find a zero, save the spot(move this into a hash)\n if cell == 0\n columns[c] = 1\n zero_count = 1\n end\n end\n\n #if zero exists in row, change entire row to zero\n #keep track of how many rows are changed\n if zero_count > 0\n row.each_with_index do |cell, c|\n row[c] = 0\n row_count +=1\n end\n end\n end\n\n if row_count == matrix.length\n return\n end\n\n n = 0\n #for each value in columnshash, change all column values to 0\n columns.each do |c, value|\n matrix.length.times do |r|\n matrix[r][c] = 0\n n += 1\n end\n n = 0\n end\nend", "def swap\n @working_array = @working_array.collect.with_index do |digit, index|\n swapper_map(index)[digit]\n end\n end", "def swap\n @working_array = @working_array.collect.with_index do |digit, index|\n swapper_map(index)[digit]\n end\n end", "def matrix_convert_to_0(matrix)\n zero_locations = location_of_zeros(matrix)\n\n coordinates = 0\n while coordinates < zero_locations.length do\n row_to_change = zero_locations[coordinates][0]\n column_to_change = zero_locations[coordinates][1]\n\n # change row here\n change_row = 0\n while change_row < matrix.length do\n matrix[row_to_change][change_row] = 0\n change_row += 1\n end\n\n # change column here\n change_column = 0\n while change_column < matrix.length do\n# puts \"Inside change column section\"\n matrix[change_column][column_to_change] = 0\n# puts \"#{matrix[change_column][column_to_change]}\"\n change_column += 1\n# puts \"Next iteration\"\n end\n\n coordinates += 1\n end\n return matrix\nend", "def reverse!(array)\n index_up = 0\n index_down = -1\n # if array == []\n # []\n # else\n loop do\n array[index_up], array[index_down] = array[index_down], array[index_up]\n index_up += 1\n index_down -= 1\n break if index_up + 1 > array.size / 2\n end\n # end\n array\nend", "def matrix_convert_to_zero(matrix)\n return nil if matrix.empty?\n\n rows = matrix.size\n columns = matrix[0].size\n\n rows.times do |row|\n columns.times do |column|\n matrix[row][column] = \"ZERO\" if matrix[row][column] == 0\n end\n end\n\n rows.times do |row|\n columns.times do |column|\n next unless matrix[row][column] == \"ZERO\"\n\n columns.times { |i| matrix[row][i] = 0 unless matrix[row][i] == \"ZERO\" }\n rows.times { |i| matrix[i][column] = 0 unless matrix[i][column] == \"ZERO\" }\n matrix[row][column] = 0\n end\n end\nend", "def reverse_array(arr)\n new_arr = []\n arr.length.times do |i|\n new_arr = new_arr.unshift(arr[i])\n end\n new_arr\nend", "def reverse!(arr)\n (arr.size / 2).times { |idx| arr[idx], arr[-1 - idx] = arr[-1 - idx], arr[idx] }\n arr\nend", "def reverse!(arr)\n values = arr.dup\n arr.each.with_index do |_, index|\n arr[index] = values[-index - 1]\n end\nend", "def solve_array(array)\n check_array = Array.new(9){Array.new(9){Array.new(9){0}}}\n # p array\n for i in 0..8\n for j in 0..8\n if array[i][j] == 0\n p \"for each variable\\n\\n\\n\\n\\n\\n\\n\\n #{i}, #{j}\"\n p \"before_modify #{check_array[i][j]} 1\"\n modify_check_array(array, check_array, i, j)\n p check_array[i][j]\n if count_value(check_array[i][j]) == 1\n p check_array[i][j]\n p \"for ij #{i}, #{j}\"\n array[i][j] = get_value(check_array[i][j])\n end\n end\n end\n end\n end", "def rotate_array(array)\n first_value = array.slice(0)\n other_values = array.slice(1..-1)\n other_values << first_value\nend", "def rotate_array(array)\n first_value = array.slice(0)\n other_values = array.slice(1..-1)\n other_values << first_value\nend", "def pair_zeros(arr)\n arr.select.each_with_index do |num, idx|\n num != 0 || (num == 0 && count(arr, num, idx) % 2 == 1)\n end\nend", "def zero n\r\n rows_x = []\r\n n.times { rows_x << [0]*n }\r\n Matrix[ *rows_x ]\r\n end", "def symmetrize(array)\n\t\tfirst_matrix = Matrix.rows(array)\n\t\tfirst_matrix.each_with_index do |e, row, col|\n\n\t\t\tunless e == first_matrix[col, row]\n\t\t\t\tif e == 0\n\t\t\t\t\t# puts row, col\n\t\t\t\t\t# puts our_matrix[col,row]\n\t\t\t\t\tarray[col][row] = 0\n\t\t\t\telsif e == 1\n\t\t\t\t\tarray[row][col] = 0\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tsecond_matrix = Matrix.rows(array)\n\t\treturn second_matrix\n\tend", "def shift arr\n arr.shift\n arr.push(0)\nend" ]
[ "0.75967336", "0.74537593", "0.7418099", "0.7378691", "0.735207", "0.7315849", "0.7246049", "0.7181783", "0.71808875", "0.69366425", "0.6887754", "0.68305194", "0.68170255", "0.679784", "0.6786388", "0.67555135", "0.6749932", "0.67464906", "0.6743448", "0.669853", "0.66448635", "0.66232467", "0.6610103", "0.66048324", "0.6597989", "0.6557611", "0.655046", "0.6538811", "0.6509088", "0.6500068", "0.64418536", "0.64111197", "0.6400303", "0.638875", "0.63547695", "0.63495904", "0.6334815", "0.6326105", "0.631957", "0.63182765", "0.6284823", "0.62785023", "0.62700963", "0.6263737", "0.62538797", "0.6246923", "0.62087095", "0.62014276", "0.6196561", "0.6165543", "0.61600035", "0.6130674", "0.6127651", "0.6114495", "0.6108243", "0.61047024", "0.609504", "0.6078274", "0.6056761", "0.6055026", "0.6042563", "0.6041964", "0.6011453", "0.6008692", "0.600231", "0.5998164", "0.59924173", "0.5981899", "0.59386915", "0.59347564", "0.59327644", "0.5925352", "0.5919805", "0.590556", "0.590174", "0.59003043", "0.58975536", "0.5891504", "0.5886079", "0.58843213", "0.5861919", "0.5859648", "0.58596444", "0.58588433", "0.585698", "0.5844784", "0.5844784", "0.58405954", "0.5836451", "0.5821783", "0.58186007", "0.58113724", "0.5808671", "0.5802947", "0.58021677", "0.5801299", "0.5797859", "0.5793191", "0.57867044", "0.5782046" ]
0.71871465
7
GET /system/platform_accounts GET /system/platform_accounts.json
def index @system_platform_accounts = System::PlatformAccount.all.order(created_at: :desc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @platform_accounts = PlatformAccount.all\n end", "def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end", "def social_accounts_for_a_project\n uri = \"#{@api_url}/#{@project_id}/accounts?access_token=#{@access_token}\"\n get uri\n end", "def get_accounts()\n http_get(accounts_url)\n end", "def getAccounts\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n http = broker_url + \"/resources/accounts\"\n res = httpGETRequest(http)\n return res\n end", "def accounts\n get('/accounts')['accounts']\n end", "def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\n end", "def index\n @platform_account_types = PlatformAccountType.all\n end", "def listaccounts(minconf = 1)\n @api.request 'listaccounts', minconf\n end", "def get_account\n as_json(get_results('/account'))\n end", "def index\n @accounts = current_user.person.blackberry_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def services\n params = { command: 'account_services' }\n get('/json.php', params)\n end", "def index\n @api_v1_accounts = Api::V1::Account.all\n end", "def index\n\n begin\n\n @accounts = Account.active\n render json: @accounts.to_json(:except=>:password, :methods => [:subdomains, :template] )\n\n rescue => e\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end", "def index\n @accounts = current_user.person.phone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def get_acc_info\n JSON.parse(curl_get(\"/api2/account/info/\").body_str)\n end", "def get_accounts\n response_xml = http_get(@client, \"#{xero_url}/Accounts\")\n parse_response(response_xml, {}, {:request_signature => 'GET/accounts'})\n end", "def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end", "def fetch_accounts\n log 'fetch_accounts'\n data = get(PRODUCTS_ENDPOINT, fields: { carteras: false,listaSolicitada: 'TODOS',indicadorSaldoPreTarj: false })\n cuentas = data['datosSalidaCuentas']['cuentas'].zip(data['datosSalidaCodIban']['datosIban'])\n cuentas.map{ |data| build_account(data) }\n end", "def list_gen1_accounts() \n response = HTTParty.get(\"https://management.azure.com/subscriptions/#{subscriptionId}/providers/Microsoft.DataLakeStore/accounts?api-version=2016-11-01\", {\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def show\n authorize @accounts\n render json: @account\n end", "def list\n token = SocialService::Facebook.renew_token(token_params)\n\n accounts =\n SocialService::Facebook\n .accounts(token)\n .reject { |a| a[:id].in?(facebook_account_ids) }\n\n render json: { accounts: accounts }\n end", "def list_accounts\n\ttp Account.all\nend", "def get_accounts\n response_xml = http_get(\"#{xero_url}/accounts\")\n parse_response(response_xml)\n end", "def fetch_accounts\n log 'fetch_accounts'\n\n custom_headers = {\n 'Content-Type' => 'application/json; charset=UTF-8',\n 'Contexto' => get_context\n }\n\n params = {\n \"peticionCuentasKYOSPaginadas\" => {\n \"favoritos\" => false,\n \"paginacion\" => \"0\"\n }\n }\n\n response = with_headers(custom_headers) do\n post(BASE_ENDPOINT + ACCOUNTS_ENDPOINT, fields: params.to_json)\n end\n\n json = JSON.parse(response)\n\n if json['respuestacuentas']['cuentas'].is_a? Array\n # TODO: test this with a user with multiple accounts\n json['respuestacuentas']['cuentas'].map { |data| build_account(data) }\n else\n [build_account(json['respuestacuentas']['cuentas'])]\n end\n end", "def all\n @dealing_platform.gather 'accounts', :accounts, Account\n end", "def get_accounts(page = 1, \r\n limit = 10, \r\n filter = nil, \r\n sort = nil)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'page' => page,\r\n 'limit' => limit,\r\n 'filter' => filter,\r\n 'sort' => sort\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "def index\n @accounts = current_user.person.linked_in_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def path\n ['cloud-service-auth', 'accounts', @id].join('/')\n end", "def set_system_platform_account\n @system_platform_account = System::PlatformAccount.find(params[:id])\n end", "def account(params = {})\n make_get_request('/account', params)\n end", "def index\n @pt_accounts = current_user.pt_accounts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pt_accounts }\n end\n end", "def set_platform_account\n @platform_account = PlatformAccount.find(params[:id])\n end", "def get_accounts(token)\n result = get_user_from_token(token)\n user_id = result.raw['userID']\n\n # Find the correct account\n accounts = result.raw['accounts'].select do |account|\n account['accountNo'] == account_number\n end\n\n if accounts.count > 0\n return {\n user_id: user_id,\n accounts: result.raw['accounts']\n }\n else\n raise Trading::Errors::LoginException.new(\n type: :error,\n code: '403',\n description: 'Accounts could not be found',\n messages: ['Accounts could not be found']\n )\n end\n end", "def index\n if is_branch_manager?\n @user_accounts = UserAccount.all\n success_response(message: 'All Accounts', data: { user_accounts: @user_accounts })\n else\n error_response(message: response.status_message, data: response.data)\n end\n end", "def account\n get('account')\n end", "def index\n @accounts = policy_scope(Account)\n\n render json: @accounts, include: [:user]\n end", "def index\n response = @account_api.find_all\n if response[:status].to_i == 403\n redirect_to home_index_path\n flash[:alert] = \"You are not allowed to access this page\"\n end\n\n @accounts = response[:accounts]\n end", "def index\n @oauth_accounts = OauthAccount.all\n end", "def accounts\n request = request(method: :get, path: \"/Account.json\")\n response = request.perform\n instantiate(response[\"Account\"], Lightspeed::Account)\n end", "def account_info(options = {})\n request :account, :get, 'account', options\n end", "def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n end", "def get_gen1_account_info(name) \n response = HTTParty.get(\"https://management.azure.com/subscriptions/#{subscriptionId}/resourceGroups/#{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/#{name}?api-version=2016-11-01\", {\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def index\n @user_accounts_app = User.where(\"role=? and is_register=?\",USER_ROLE, 0).page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_account_apps }\n end\n end", "def index\n @accounts = current_user.person.iphone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def fetch_accounts\n # First we need to fetch the products / views for the user\n \n user_response = JSON.parse(get(BASE_ENDPOINT + USER_ENDPOINT))\n view = user_response['views'].find { |view| view['type'] == 0}\n view_id = view['id']\n\n # Now we get the accounts for that product / view\n products_response = JSON.parse(get(BASE_ENDPOINT + PRODUCTS_ENDPOINT + \"/#{view_id}\"))\n\n # Find which products are accounts\n products_response.select! do |product|\n product['$type'] == 'Arquia.Backend.Domain.Models.Entities.Account, Arquia.Backend.Domain.Models'\n end\n\n products_response.map { |account| build_account(account) }\n end", "def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend", "def listaccounts(minconf = 1)\n coind.listaccounts minconf\n end", "def get_account_status\n send_post(\"/accountStatus\", {})\n end", "def get_account_status\n send_post(\"/accountStatus\", {})\n end", "def index\n @accounts = current_user.accounts\n @wallet = current_user.wallet\n authorize @accounts\n end", "def index\n @accounts = @project.accounts\n end", "def all_accounts\n puts params[:id]\n accounts = []\n user = User.find params[:id]\n user.accounts.each do |f|\n accounts << {id:f.id, title: f.title}\n end\n render json: accounts\n end", "def get_accounts\n @accounts = Account.all\n end", "def subaccounts()\n get('subAccounts')\n end", "def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend", "def list_users_for_all_tenants(args = {}) \n get(\"/users.json/global\", args)\nend", "def get_basic_account_info\n body = {cmd: \"get_basic_info\"}\n post body\n end", "def portfolio_accounts\n data = call_api(method: \"get\", url: \"/portfolio/accounts\" )\n @accountId = data.first[\"accountId\"]\n @accountId\n end", "def index\n\t\t@accounts = Account.all\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @accounts }\n\t\tend\n\tend", "def index\n @accounts = current_user.person.gmail_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def rip_accounts()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" +\n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZNAME IS NOT NULL\") do |row|\n rip_account(row[\"Z_PK\"])\n end \n end\n\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZACCOUNT.Z_PK FROM ZACCOUNT\") do |row|\n rip_account(row[\"Z_PK\"])\n end\n end\n\n @accounts.each_pair do |key, account|\n @logger.debug(\"Rip Accounts final array: #{key} corresponds to #{account.name}\")\n end\n\n end", "def sub_accounts(conditions = {})\n client.accounts.list(conditions)\n end", "def index\n @accounts = current_user.accounts\n end", "def index\n @accounts = current_user.accounts\n end", "def index\n @account = Account.find(params[:account_id])\n @users = @account.users\n respond_to do |format|\n format.json { render json: @account.users.paginate(page: @page, per_page: @per_page) }\n end\n end", "def index\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n accounts = Account.where(user_id: user[\"id\"])\n render json: accounts, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def index\n authorize! :manage, Account\n add_breadcrumb t(:'hyrax.controls.home'), root_path\n add_breadcrumb t(:'hyrax.admin.sidebar.accounts'), proprietor_accounts_path\n end", "def get_accounts(page = 1, limit = 10, filter = nil)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\r\n 'page' => if page.nil? then 1 else page end,\r\n 'limit' => if limit.nil? then 10 else limit end,\r\n 'filter' => filter\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers: headers\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "def tenant_list\n\t\t\n\t\tget_call = Curl::Easy.http_get(\"#{@ip_address}:#{@port_2}/v2.0/tenants\"\n\t\t) do |curl| curl.headers['x-auth-token'] = @token end\n\t\t\n\t\tputs \"invoking tenant-list...\"\n\t\t\n\t\tparsed_json = JSON.parse(get_call.body_str)\n\t\t\n\t\tputs parsed_json\n\t\treturn parsed_json\n\tend", "def show\n @account = current_user.person.blackberry_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def get_accounts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'\n end\n # resource path\n local_var_path = '/accounts'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountListResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#get_accounts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list_accounts(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n accounts.each do |acc|\n print_account(acc)\n end\nend", "def account_info()\n response = @session.do_get build_url(\"/account/info\")\n parse_response(response)\n end", "def accounts\n response = query_api(\"/rest/accounts\")\n return response[\"accounts\"].map {|account| Account.new(self, account)}\n end", "def accounts\n @accounts_manager\n end", "def get_accounts_by_user\n return User.find(params[:user_id]).accounts\n end", "def admin\n unless admin_user?\n authenticate_admin\n return\n end\n @accounts = Account.user_accounts\n @projects = []\n @users = []\n \n respond_to do |format|\n format.html # admin.html.erb\n format.json { render json: @accounts }\n end \n end", "def index\n auth_response = plaid_client.auth.get(access_token)\n render json: auth_response.to_json\n end", "def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end", "def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end", "def account(id)\n make_json_api_request :get, \"v2/accounts/#{id}\"\n end", "def create\n @platform_account = PlatformAccount.new(platform_account_params)\n\n respond_to do |format|\n if @platform_account.save\n format.html { redirect_to @platform_account, notice: 'Platform account was successfully created.' }\n format.json { render :show, status: :created, location: @platform_account }\n else\n format.html { render :new }\n format.json { render json: @platform_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_accounts(client, options)\n # TODO: Add exception handling \n if !options[:application].nil?\n application = client.applications.get options[:application]\n return application.accounts\n elsif !options[:directory].nil?\n directory = client.directories.get options[:directory]\n return directory.accounts\n elsif !options[:group].nil?\n group = client.groups.get options[:group]\n return group.accounts\n else\n puts \"Missing arguments\"\n return nil\n end \nend", "def accounts\n end", "def get_accounts_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AccountsApi.get_accounts ...'\n end\n # resource path\n local_var_path = '/v1/accounts'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/links+json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] || 'InlineResponse20011' \n\n auth_names = opts[:auth_names] || ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#get_accounts\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def remote_accounts(fields: nil)\n params = build_fields_params fields\n res = @connection.get remote_account_path, params\n map_as_collection res, RemoteAccount\n end", "def index\n @organization_accounts = OrganizationAccount.all.sort_by(&:organization_name).reverse\n \n if user_signed_in? && current_user.admin?\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organization_accounts }\n end\n else\n redirect_to root_path\n end\n end", "def index\n @external_credentials = ExternalCredential.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @external_credentials }\n end\n end", "def authentication_providers authenticator, account: Conjur.configuration.account\n JSON.parse(url_for(:authentication_providers, account, authenticator, credentials).get)\n end", "def index\n render json: current_user.api_keys.api.active, status: 200\n end", "def get_current_tenant \n get(\"/tenants.json/current\")\nend", "def index\n index = json_account_params[:json_id].to_i if !index \n if admin_signed_in?\n @accounts = Account.all\n else\n @accounts = Account.tri(@current_user.id).all[(index)..(index + 5)]\n end\n index = index + 1\n respond_to do |format|\n format.html\n format.json { render json: @accounts, locals: {last: \"@last\"} }\n end\n end", "def getaccount(bitcoinaddress)\n @api.request 'getaccount', bitcoinaddress\n end", "def list_users_for_tenant(args = {}) \n get(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend", "def resource_name\n :account\n end", "def list_of_accounts_online\n Stripe.api_key = Rails.application.credentials.stripe[Rails.env.to_sym][:secret_key]\n return Stripe::Account.list\n end", "def create\n @system_platform_account = System::PlatformAccount.new(system_platform_account_params)\n if @system_platform_account.save\n record_activities('创建接入账号', @system_platform_account.account_name)\n flash[:success] = '创建接入账号成功'\n redirect_to system_platform_accounts_path\n else\n flash[:error] = \"创建失败: #{@system_platform_account.errors.full_message}\"\n render :new\n end\n end", "def all\n result = @dealing_platform.session.get('accounts').fetch :accounts\n\n @dealing_platform.instantiate_models Account, result\n end", "def all(params = {})\n @client.make_request(:get, 'carrier_accounts', MODEL_CLASS, params)\n end" ]
[ "0.71803", "0.7104645", "0.70181173", "0.7009661", "0.68501115", "0.66124415", "0.64616865", "0.6403624", "0.6352732", "0.62865174", "0.62178135", "0.61433905", "0.6135354", "0.6112601", "0.6078784", "0.60730547", "0.6033302", "0.6006916", "0.5996568", "0.5990285", "0.59895504", "0.5968684", "0.59578776", "0.5941398", "0.59203726", "0.59020436", "0.58948976", "0.5892425", "0.5888348", "0.5882324", "0.5871323", "0.58354366", "0.582803", "0.58263576", "0.5816039", "0.581602", "0.58158827", "0.58140105", "0.5796718", "0.57781774", "0.5768766", "0.57656", "0.5756738", "0.57540035", "0.57318217", "0.5731731", "0.57281685", "0.571262", "0.5705937", "0.5705937", "0.56966895", "0.5696535", "0.5694197", "0.5681573", "0.5681487", "0.567462", "0.567462", "0.56711423", "0.566305", "0.56510663", "0.56422985", "0.56398857", "0.56320643", "0.56225127", "0.56225127", "0.56183267", "0.56131405", "0.56119084", "0.55884075", "0.5587852", "0.55844665", "0.5580563", "0.55724394", "0.5564392", "0.55613536", "0.5558393", "0.55563194", "0.55538523", "0.55530506", "0.5534795", "0.5534795", "0.5533775", "0.5533428", "0.55294895", "0.5512919", "0.5510531", "0.5493094", "0.54849505", "0.54788536", "0.54756933", "0.54703414", "0.54688585", "0.5454993", "0.54533565", "0.5449639", "0.544655", "0.54443014", "0.54332", "0.54299486", "0.54264736" ]
0.69320863
4
POST /system/platform_accounts POST /system/platform_accounts.json
def create @system_platform_account = System::PlatformAccount.new(system_platform_account_params) if @system_platform_account.save record_activities('创建接入账号', @system_platform_account.account_name) flash[:success] = '创建接入账号成功' redirect_to system_platform_accounts_path else flash[:error] = "创建失败: #{@system_platform_account.errors.full_message}" render :new end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @platform_account = PlatformAccount.new(platform_account_params)\n\n respond_to do |format|\n if @platform_account.save\n format.html { redirect_to @platform_account, notice: 'Platform account was successfully created.' }\n format.json { render :show, status: :created, location: @platform_account }\n else\n format.html { render :new }\n format.json { render json: @platform_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n megam_rest.post_accounts(to_hash)\n end", "def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "def create\n @platform_account_type = PlatformAccountType.new(platform_account_type_params)\n\n respond_to do |format|\n if @platform_account_type.save\n format.html { redirect_to @platform_account_type, notice: 'Platform account type was successfully created.' }\n format.json { render :show, status: :created, location: @platform_account_type }\n else\n format.html { render :new }\n format.json { render json: @platform_account_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_accounts\n end", "def create\n @account = current_user.accounts.build params[:account]\n \n account_array = accounts_from_credentials @account.api_email, @account.api_password\n \n accounts = account_array.map do |account_info|\n account = current_user.accounts.build params[:account]\n \n account.api_id = account_info.accountID\n account.api_name = account_info.accountName\n account.api_user_id = account_info.userID\n \n account\n end\n\n respond_to do |format|\n if !accounts.blank? && accounts.map(&:valid?).all? && accounts.map(&:save).all?\n flash[:notice] = \"#{accounts.size == 1 ? 'Account was' : \"#{accounts.size} accounts were\"} successfully created.\"\n format.html { redirect_to(@account) }\n format.xml { render :xml => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def add_user_for_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend", "def create_account\n\n end", "def create\n @account = PhoneAccount.new(params[:phone_account])\n current_user.person.phone_accounts << @account\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => 'new' }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def platform_account_params\n params.require(:platform_account).permit(:platform_id, :member_id, :tag, :internal_link)\n end", "def create\n # Get the credit card details submitted by the form\n @account = Account.new\n authorize @account\n @account.user_id = account_params[:user_id]\n @account.package_id = account_params[:package_id];\n @user = User.find(account_params[:user_id])\n @account.users << @user\n @account.active = FALSE\n\n if @account.save\n render json: {status: :created, account: @account}\n else\n render json: { error: @account.errors, status: :unprocessable_entity }\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @platform_balanceio= @platform_account.platform_balanceios.build platform_balanceios_params\n respond_to do |format|\n if @platform_balanceio.save\n format.html { redirect_to manage_platform_platform_account_platform_balanceios_path(@platform, @platform_account), notice: 'User was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end", "def create_gen1_account(name) \n\n account_create = {\n \"location\"=> \"centralus\",\n \"tags\"=> {\n \"test_key\"=> \"test_value\"\n },\n \"identity\"=> {\n \"type\"=> \"SystemAssigned\"\n },\n \"properties\"=> {\n \"encryptionState\"=> \"Enabled\",\n \"encryptionConfig\"=> {\n \"type\"=> \"ServiceManaged\",\n },\n \"firewallState\"=> \"Disabled\",\n \"firewallRules\"=> [\n \n ],\n \"trustedIdProviderState\"=> \"Disabled\",\n \"trustedIdProviders\"=> [\n \n ],\n \n \"newTier\"=> \"Consumption\",\n \"firewallAllowAzureIps\"=> \"Enabled\"\n }\n }\n\n response = HTTParty.put(\"https://management.azure.com/subscriptions/#{subscriptionId}/resourceGroups/#{resourceGroupName}/providers/Microsoft.DataLakeStore/accounts/#{name}?api-version=2016-11-01\", {\n\n body: account_create.to_json,\n\n headers: {\n \"Authorization\" => \"Bearer #{bearerToken}\",\n \"Content-Type\" => 'application/json', \n \"Accept\" => '*/*',\n \"Cache-Control\" => 'no-cache',\n \"Connection\" => 'keep-alive',\n \"cache-control\" => 'no-cache'\n },\n \n verify: true,\n })\n\n return JSON.parse response.read_body\n end", "def create\n @account = BlackberryAccount.new(params[:blackberry_account])\n current_user.person.blackberry_accounts << @account\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n user = AuthenticationManager.new(\n params.slice(%i[email first_name last_name password]).merge(is_profile_owner: true, password_confirmation: params[:password], tos_accepted: params.bool(:tos_accepted))\n ).register\n user = session_manager.login(user.email, params[:password], use_api_token: true)\n json_success user: api_response.current_user_data(user)\n end", "def create_account(options)\n form_data = options.merge({ 'action' => 'createaccount' })\n res, dummy = make_api_request(form_data)\n res\n end", "def save\n # TODO validar atributos?\n response = Http.post(\"/organizations/api/identities/#{self.identity.uuid}/accounts/\", create_body)\n raise \"unexpected response: #{response.code} - #{response.body}\" unless response.code == 201\n attributes_hash = MultiJson.decode(response.body)\n set_attributes(attributes_hash)\n @persisted = true\n @errors = {}\n true\n rescue *[RestClient::BadRequest] => e\n @persisted = false\n @errors = MultiJson.decode(e.response.body)\n false\n end", "def set_platform_account\n @platform_account = PlatformAccount.find(params[:id])\n end", "def create\n @account = IphoneAccount.new(params[:iphone_account])\n current_user.person.iphone_accounts << @account\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @api_v1_account = Api::V1::Account.new(api_v1_account_params)\n\n respond_to do |format|\n if @api_v1_account.save\n format.html { redirect_to @api_v1_account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_account }\n else\n format.html { render :new }\n format.json { render json: @api_v1_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_account(user)\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"email\" => user.email, \"name\" => user.username })\nend", "def add_account(payload)\n post(url_, payload)\n end", "def platform_account_type_params\n params.require(:platform_account_type).permit(:name, :platform_id, :endpoint, :schema, :field_mapping)\n end", "def create_external_resources\n create_account_inline && account.save && create_tenant\n end", "def save\n Account.create!(account_params.map do |data|\n {\n type: :facebook,\n user: current_user,\n name: data[:name],\n data: data\n }\n end)\n\n render json: success\n end", "def create\n #@current_account = CurrentAccount.new(current_account_params)\n @current_account = current_user.current_accounts.new(current_account_params)\n\n respond_to do |format|\n if @current_account.save\n format.html { redirect_to @current_account, flash: { success: \"AccountPayable was successfully created.\" } }\n format.json { render :show, status: :created, location: @current_account }\n else\n format.html { render :new }\n format.json { render json: @current_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_account\n unless authenticated?\n payload = encode( { :user => { :github_account => github_user } } )\n response = site['users.json'].post payload, :content_type => :json\n !response.nil?\n end\n end", "def create\n @account = Account.new(params[:account])\n @account.owner = current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(body = {})\n @client.account.create(body)\n end", "def set_system_platform_account\n @system_platform_account = System::PlatformAccount.find(params[:id])\n end", "def create\n response = @account_api.create(params)\n\n respond_to do |format|\n if response[:status] == 201\n format.html { redirect_to accounts_path , notice: 'Account successfully created.' }\n format.json { render :show, status: :created, location: user_path(response[:body]) }\n else\n format.html { redirect_to new_account_path, alert: formatted_error_message(response).join(\"<br/>\").html_safe }\n format.json { render json: response[:body], status: :unprocessable_entity }\n end\n end\n end", "def system_platform_account_params\n params[:system_platform_account].except(:id).permit!\n end", "def setup_accounts\n self.accounts.create({:name => \"Checking\"})\n self.accounts.create({:name => \"Savings\"})\n end", "def create_basic_account(http, account_name, identity_card)\n begin\n response = http.post 'Create a new account', \"#{SERVER}/accounts\", {\n 'lineId' => 1,\n 'username' => account_name,\n 'password' => account_name,\n 'email' => \"#{account_name}@lvs.co.uk\",\n 'countryCode' => 'IL',\n 'currencyCode' => 'ILS',\n 'online' => true,\n 'status' => 'open',\n 'identityCardNumber'=> identity_card\n }\n account_id = JSON.parse(response.body)['id']\n account_uri = response.headers[:location]\n \n response = http.post 'Create a new transaction', \"#{SERVER}/accounts/#{account_id}/transactions\", {\n 'transactionSubType' => 'CREDIT_CARD',\n 'transactionType' => 'PAYMENTRECEIPT',\n 'accountId' => account_id,\n 'credit' => '10000',\n 'description' => 'Payment via REST API',\n }\n return account_id, account_uri\n end\nend", "def create\n @account = Account.new(params[:account])\n respond_to do |format|\n if @account.save\n \n format.html { redirect_to \"http://#{@account.name}.#{request.domain}#{request.port_string}/login\", notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def account_create(uid,display_name)\n user_hash = @client.user_create(\"#{uid}\",\"#{display_name}\")\n Rails.logger.debug '> Radosgw: Account create'\n user_json = user_hash.to_json\n storage = Storage.new(STORAGES_BUCKET)\n storage.upload(uid, user_json, 'application/json')\n user_hash\n end", "def managed\n connector = StripeManaged.new(current_customer)\n account = connector.create_account!(\n params[:country], params[:tos] == 'on', request.remote_ip\n )\n\n if account\n flash[:notice] = \"Managed StripeAccount account created! <a target='_blank' rel='platform-account' href='https://dashboard.stripe.com/test/applications/users/#{account.id}'>View in dashboard &raquo;</a>\"\n else\n flash[:alert] = 'Unable to create StripeAccount account!'\n end\n redirect_to customer_path(current_customer)\n end", "def create\n super\n acc = Account.create!(:company_name => params[:account][:company_name]) unless flash.blank?\n # Set admin and account_id for User \n resource.update_attributes!({:account_id => acc.id, :is_admin => true, :status => SettingsConfig::ENABLED}) unless flash.blank?\n end", "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token , uid: user.id }\n json_response(response, :created)\n end", "def create_private_pos_account\n @pos_account_type = PosAccountType.where(\"token = '57d3c9d284c0'\")\n @pos_account = User.find_by_certified_agent_id(params[:certified_agent_id])\n\n init_form\n\n pos_account_type = PosAccountType.find_by_id(params[:user][:pos_account_type_id])\n\n build_resource(params[:user].merge({profile_id: Profile.find_by_name(pos_account_type.name).id, pos_account_type_id: pos_account_type.id, company: params[:user][:company], rib: params[:user][:rib], bank_code: params[:user][:bank_code], wicket_code: params[:user][:wicket_code], account_number: params[:user][:account_number], activities_description: params[:user][:activities_description], certified_agent_id: params[:certified_agent_id], sub_certified_agent_id: SecureRandom.hex(9), identification_token: Digest::SHA1.hexdigest([DateTime.now.iso8601(6), rand].join), password: \"password\", password_confirmation: \"password\"}))\n\n if resource.save\n=begin\n # Création de lid agent agréé sur paymoney\n if (pos_account_type.name rescue nil) == \"POS marchand\"\n account_type = \"OTpPcVxO\"\n else\n account_type = \"jVUdVQBK\"\n end\n\n request = Typhoeus::Request.new(URI.escape(\"#{Parameter.first.paymoney_url}/PAYMONEY_WALLET/rest/create_compte_pariculier/#{account_type}/#{resource.firstname}/#{resource.lastname}/#{Date.today}/#{resource.email}/#{resource.identification_token}/#{resource.mobile_number}/nulll/nulll/nullllllllll/nu/#{@pos_account.paymoney_token}/#{resource.country.name}\"), followlocation: true, method: :get)\n\n clown = resource.clone\n\n request.on_complete do |response|\n if response.success?\n response = JSON.parse(response.body) #rescue nil\n if response.blank?\n resource.errors.add(:id, \"Une erreur s'est produite, veuillez contacter l'administrateur.\")\n else\n case (response[\"status\"][\"idStatus\"].to_s rescue \"\")\n when \"1\"\n resource.update_attributes(created_on_paymoney_wallet: true, paymoney_account_number: response[\"compteNumero\"], paymoney_password: response[\"comptePassword\"], paymoney_token: response[\"compteLibelle\"])\n when \"4\"\n resource.errors.add(:id, \"Ce compte existe déjà.\")\n\n clown.delete\n else\n resource.errors.add(:id, \"Une erreur inconnue s'est produite, veuillez contacter l'administrateur. Statut: #{response[\"status\"][\"idStatus\"].to_s rescue \"\"} Message: #{response[\"status\"][\"idStatus\"].to_s rescue \"\"}\")\n clown.delete\n end\n end\n else\n clown.delete\n resource.errors.add(:id, \"La ressource n'est pas disponible, veuillez contacter l'administrateur.\")\n end\n end\n\n request.run\n=end\n\n # Création de lid agent agréé sur paymoney wallet pour les marchands\n if ((pos_account_type.name rescue nil) == \"POS particulier\" ) && (resource.created_on_paymoney_wallet rescue nil) == true\n request = Typhoeus::Request.new(\"#{Parameter.first.paymoney_wallet_url}/api/86d138798bc43ed59e5207c68e864564/#{resource.certified_agent_id}/#{resource.sub_certified_agent_id}/#{resource.paymoney_account_number}/#{resource.paymoney_token}\", followlocation: true, method: :get)\n\n request.on_complete do |response|\n if response.success?\n if (request.response.body rescue nil) == \"1\"\n resource.update_attribute(:created_on_paymoney_wallet, true)\n flash.now[:success] = \"Le compte a été correctement créé. \"\n build_resource({})\n else\n end\n end\n end\n\n request.run\n end\n else\n clean_up_passwords resource\n end\n\n\n #render text: \"#{Parameter.first.paymoney_url}/PAYMONEY_WALLET/rest/create_compte/#{account_type}/#{resource.firstname}/#{resource.lastname}/null/#{resource.email}/#{resource.identification_token}/#{resource.mobile_number}/#{resource.bank_code}/#{resource.wicket_code}/#{resource.account_number}/#{resource.rib}/#{resource.country.name}\"\n render :new_private_pos_account\n end", "def create\n @pt_account = current_user.pt_accounts.build(params[:pt_account])\n\n respond_to do |format|\n if @pt_account.save\n format.html { redirect_to [@pt_account.user, @pt_account], \n notice: 'Account was successfully created.' }\n format.json { render json: @pt_account, status: :created, \n location: [@pt_account.user, @pt_account] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pt_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_account(account_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts'\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.post query_url, headers: headers, parameters: account_form.to_json\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "def index\n @platform_accounts = PlatformAccount.all\n end", "def create_account_link\n render json: Stripe::AccountLink.create(account_params.to_h), status: :created\n end", "def eth_accounts\n params = []\n data = {\"jsonrpc\" => \"2.0\", \"method\" => \"eth_accounts\", \"params\" => params, \"id\" => \":1\"}\n @http_client.post(data) do |response|\n NSLog(response.to_s)\n @accounts_result.stringValue = response\n end\nend", "def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end", "def create\n @account = Account.new(account_params.merge({ user_id: @current_user.id }))\n\n if @account.save\n render :show, status: :created, location: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "def create(params)\n put('v1/account', params)\n end", "def create\n @core_account = Core::Account.new(core_account_params)\n\n respond_to do |format|\n if @core_account.save\n format.html { redirect_to @core_account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @core_account }\n else\n format.html { render :new }\n format.json { render json: @core_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def save\n response = if @id.nil?\n @cloud.auth_for_accounts [@parent]\n @cloud.post ['cloud-service-auth', 'accounts'], self\n else\n @cloud.post path, self\n end\n apply_data(response.body)\n self\n end", "def create\n @platform = Platform.new(platform_params)\n respond_to do |format|\n if @platform.save\n format.html { redirect_to manage_platforms_path, notice: 'platform was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user }\n else\n format.html { render action: 'new' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def sign_up\n NexaasID::Resources::SignUp.new(api_token, config)\n end", "def create\n @account = Account.new(account_params)\n @account.user_created_id = current_user.id\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: I18n.t('account.controller.create') }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_admin_account\n account = Account.create!\n self.account = account\n self.account_owner = true\n end", "def create_user_and_login \n\t\tinsert_into :users, {\n\t\t\tid: 1 ,\n\t\t\tfirst_name: 'First',\n\t\t\tlast_name: 'Last',\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password',\n\t\t\trole_id: 1,\n\t\t\tuid: \"a\"\n\t\t}\n\n\t\tproxy.post( 'http://my.ownet/api/session',{\n\t\t\tlogin: 'login',\n\t\t\tpassword: 'password'\n\t\t}.to_json)\n\tend", "def createAPI\n \n idLoL = LOL_WRAPPER.get_summoner_id(params[:accname], params[:region])\n #Find the summoner with the corresponding id and region\n @summoner = LOL_WRAPPER.get_summoner_by_id(idLoL, params[:region])\n \n #Create or update the corresponding account in our database\n if Account.exists?(:idLoL => idLoL)\n @account = Account.find_by_idLoL(idLoL)\n @account.pseudoLoL = @summoner.name\n @account.save\n else\n @account = Account.new(idLoL: idLoL, region: params[:region], pseudoLoL: @summoner.name)\n @account.save\n end\n\n @trackgroup.accounts << @account\n redirect_to(:back)\n \n end", "def setup_new_bank_account(bank_code, credentials, country = 'de', options = {})\n data = { \"bank_code\" => bank_code,\n \"country\" => country,\n \"credentials\" => credentials\n }\n data = data.merge(options)\n query_api \"/rest/accounts\", data, \"POST\"\n end", "def create\n @saving_account = current_user.portfolios.default.saving_accounts.build(saving_account_params)\n\n respond_to do |format|\n if @saving_account.save\n format.html { redirect_to root_path, notice: 'Saving Account was successfully added.' }\n format.json { render :show, status: :created, location: @saving_account }\n else\n format.html { render :new }\n format.json { render json: @saving_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_pos_account\n @pos_account_type = PosAccountType.where(\"token = 'a3fde11549ed'\")\n saved = false\n\n init_form\n\n pos_account_type = PosAccountType.find_by_id(params[:user][:pos_account_type_id])\n\n build_resource(params[:user].merge({profile_id: (Profile.find_by_name('POS marchand').id rescue nil), pos_account_type_id: (pos_account_type.id rescue nil), company: params[:user][:company], rib: params[:user][:rib], bank_code: params[:user][:bank_code], wicket_code: params[:user][:wicket_code], account_number: params[:user][:account_number], activities_description: params[:user][:activities_description], certified_agent_id: SecureRandom.hex(8), identification_token: Digest::SHA1.hexdigest([DateTime.now.iso8601(6), rand].join)}))\n\n if resource.save\n # Création de lid agent agréé sur paymoney\n if (pos_account_type.name rescue nil) == \"POS marchand\"\n account_type = \"OTpPcVxO\"\n else\n account_type = \"jVUdVQBK\"\n end\n\n creation_url = URI.escape(\"#{Parameter.first.paymoney_url}/PAYMONEY_WALLET/rest/create_compte/#{account_type}/#{resource.firstname}/#{resource.lastname}/#{Date.today}/#{resource.email}/#{resource.identification_token}/#{resource.mobile_number}/#{resource.bank_code.blank? ? \"null\" : resource.bank_code}/#{resource.wicket_code.blank? ? \"null\" : resource.wicket_code}/#{resource.account_number.blank? ? \"null\" : resource.account_number}/#{resource.rib.blank? ? \"nu\" : resource.rib}/#{resource.country.name}\") rescue \"\"\n\n request = Typhoeus::Request.new(URI.escape(\"#{Parameter.first.paymoney_url}/PAYMONEY_WALLET/rest/create_compte/#{account_type}/#{resource.firstname}/#{resource.lastname}/#{Date.today}/#{resource.email}/#{resource.identification_token}/#{resource.mobile_number}/#{resource.bank_code.blank? ? \"null\" : resource.bank_code}/#{resource.wicket_code.blank? ? \"null\" : resource.wicket_code}/#{resource.account_number.blank? ? \"null\" : resource.account_number}/#{resource.rib.blank? ? \"nu\" : resource.rib}/#{resource.country.name}\"), followlocation: true, method: :get)\n\n clown = resource.clone\n\n request.on_complete do |response|\n if response.success?\n response = JSON.parse(response.body) rescue nil\n if response.blank?\n resource.errors.add(:id, \"Une erreur s'est produite, veuillez contacter l'administrateur.\")\n else\n case (response[\"status\"][\"idStatus\"].to_s rescue \"\")\n when \"1\"\n resource.update_attributes(created_on_paymoney_wallet: true, paymoney_account_number: response[\"compteNumero\"], paymoney_password: response[\"comptePassword\"], paymoney_token: response[\"compteLibelle\"])\n flash[:success] = \"Votre compte paymoney a été crée.\"\n when \"4\"\n resource.errors.add(:id, \"Ce compte existe déjà.\")\n\n clown.delete\n when \"2\"\n resource.update_attributes(created_on_paymoney_wallet: true, paymoney_account_number: response[\"compteNumero\"], paymoney_password: response[\"comptePassword\"], paymoney_token: response[\"compteLibelle\"])\n flash[:success] = \"Votre compte paymoney a été crée. Rendez vous dans votre boite mail pour l'activer.\"\n else\n resource.errors.add(:id, \"Une erreur inconnue s'est produite, veuillez contacter l'administrateur. Statut: #{response[\"status\"][\"idStatus\"].to_s rescue \"\"} Message: #{response[\"status\"][\"idStatus\"].to_s rescue \"\"} URL: #{creation_url}\")\n clown.delete\n end\n end\n else\n clown.delete\n resource.errors.add(:id, \"La ressource n'est pas disponible, veuillez contacter l'administrateur.\")\n end\n end\n\n request.run\n\n # Création de lid agent agréé sur paymoney wallet pour les marchands\n if ((pos_account_type.name rescue nil) == \"POS marchand\" ) && (resource.created_on_paymoney_wallet rescue nil) == true\n request = Typhoeus::Request.new(\"#{Parameter.first.paymoney_wallet_url}/api/86d138798bc43ed59e5207c68e864564/#{resource.certified_agent_id}/#{resource.paymoney_account_number}/#{resource.paymoney_token}\", followlocation: true, method: :get)\n\n request.on_complete do |response|\n if response.success?\n if (request.response.body rescue nil) == \"1\"\n resource.update_attribute(:created_on_paymoney_wallet, true)\n flash[:success] = \"Le compte a été correctement créé. \"\n saved = true\n else\n\n end\n end\n end\n\n request.run\n end\n\n #saved = true\n else\n #clean_up_passwords resource\n end\n\n\n #render text: \"#{Parameter.first.paymoney_url}/PAYMONEY_WALLET/rest/create_compte/#{account_type}/#{resource.firstname}/#{resource.lastname}/null/#{resource.email}/#{resource.identification_token}/#{resource.mobile_number}/#{resource.bank_code}/#{resource.wicket_code}/#{resource.account_number}/#{resource.rib}/#{resource.country.name}\"\n if current_user.blank? && saved == true\n sign_in(resource_name, resource)\n redirect_to posm_index_path(certified_agent_id: resource.certified_agent_id)\n else\n #build_resource({})\n render :new_pos_account\n end\n end", "def update\n if @system_platform_account.update(system_platform_account_params)\n record_activities('修改接入账号', @system_platform_account.account_name)\n flash[:success] = '修改接入账号成功'\n redirect_to system_platform_accounts_path\n else\n flash[:error] = \"修改失败: #{@system_platform_account.errors.full_message}\"\n render :edit\n end\n end", "def create\n @kakao_account = KakaoAccount.new(kakao_account_params)\n\n respond_to do |format|\n if @kakao_account.save\n format.html { redirect_to @kakao_account, notice: 'Kakao account was successfully created.' }\n format.json { render :show, status: :created, location: @kakao_account }\n else\n format.html { render :new }\n format.json { render json: @kakao_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.username, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end", "def create\n @account = Account.new(account_params)\n @account.zip = Account.random_zip\n @account.user_id = @current_user.id if @current_user\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n backend_api = current_account.backend_apis.create(create_params)\n respond_with(backend_api)\n end", "def create\n if @company = Company.find(entity_id_from_params(:company))\n respond_to do |format|\n current_user.account.companies << @company\n format.html { redirect_to root_path, notice: 'Company was successfully created.' }\n format.json\n end\n end\n end", "def create\n @om_account = OmAccount.new(params[:om_account])\n @om_account.user_id = current_user.id\n @om_account.credentials = {:tag => params[:tag], :password => params[:password]}.to_yaml\n\n respond_to do |format|\n if @om_account.save\n flash[:notice] = 'account was successfully accessed.'\n format.html { redirect_to(om_accounts_url) }\n format.xml { render :xml => @om_account, :status => :created, :location => @om_account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @om_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n user = User.create!(user_params) # will raise an error if creation fails\n # call the authentication service\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token}\n json_response(response, :created)\n end", "def create\n @oauth_account = OauthAccount.new(oauth_account_params)\n\n respond_to do |format|\n if @oauth_account.save\n format.html { redirect_to login_oauth_accounts_url(redirect_uri: params[:redirect_uri]) }\n format.json { render :show, status: :created, location: @oauth_account }\n else\n format.html { render :new }\n format.json { render json: @oauth_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_sip_account(extension, username, password)\n #password must be > 6 characters per Cloudvox\n JSON.parse((@cloudvox_api['/phones.json'].post :endpoint => {:extension => extension, :username => username, :password => password}).body)\n end", "def create\n @personal_account = PersonalAccount.new(params[:personal_account])\n\n respond_to do |format|\n if @personal_account.save\n format.html { redirect_to @personal_account, :notice => 'Personal account was successfully created.' }\n format.json { render :json => {:data => @personal_account , :success => true }, :status => :created, :location => @personal_account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => {:msg => @personal_account.errors, :status => :unprocessable_entity} }\n end\n end\n end", "def set_platform_account_type\n @platform_account_type = PlatformAccountType.find(params[:id])\n end", "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end", "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end", "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end", "def user_create(username, email, password, tenant_id)\n\t\n\t\tuser = {\"user\" => {\"name\" => username, \"email\" => email, \"enabled\" => true, \"password\" => password, \"tenantid\" => tenant_id}}\n\t\n\t\tjson_string = JSON.generate(user)\n\t\n\t\tpost_call = Curl::Easy.http_post(\"#{@ip_address}:#{@port_2}/v2.0/users\", json_string\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['Content-Type'] = 'application/json'\n\t\tend\n\t\t\t\t\t\t\t\t\t \n\t\tparsed_json = JSON.parse(post_call.body_str)\n\t\t\n\t\tputs parsed_json\n\t\treturn parsed_json\n\tend", "def create\n @account = MasterData::Account.new(account_params_with_author)\n authorize @account, :create?\n\n respond_to do |format|\n if @account.update_aliases(@aliases) && @account.save\n # keep @account.save at the end of the condition bellow to ensure the right object is returned during rendering\n\n format.html do\n render :show, notice: \"Account was successfully created.\"\n end\n format.json do\n render json: @account, status: :created, location: :api_v2_accounts\n end\n else\n format.html { render :new }\n format.json do\n render json: @account.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def sign_up(resource_name, resource)\n end", "def new_account(site_url, site_email, analyst_email, password)\n reqBody = {:site_url => site_url, :site_email => site_email,\n :analyst_email => analyst_email, :password => password}\n begin\n http_post(accounts_url(), reqBody)\n rescue Exception => e\n puts e.message\n puts e.backtrace.inspect\n end\n\n end", "def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end", "def create_external_tool_accounts(account_id,name,privacy_level,consumer_key,shared_secret,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :name,\n :privacy_level,\n :consumer_key,\n :shared_secret,\n :description,\n :url,\n :domain,\n :icon_url,\n :text,\n :custom_fields,\n :account_navigation__url__,\n :account_navigation__enabled__,\n :account_navigation__text__,\n :user_navigation__url__,\n :user_navigation__enabled__,\n :user_navigation__text__,\n :course_navigation__url__,\n :course_navigation__enabled__,\n :course_navigation__text__,\n :course_navigation__visibility__,\n :course_navigation__default__,\n :editor_button__url__,\n :editor_button__enabled__,\n :editor_button__icon_url__,\n :editor_button__selection_width__,\n :editor_button__selection_height__,\n :resource_selection__url__,\n :resource_selection__enabled__,\n :resource_selection__icon_url__,\n :resource_selection__selection_width__,\n :resource_selection__selection_height__,\n :config_type,\n :config_xml,\n :config_url,\n \n ]\n\n # verify existence of params\n raise \"account_id is required\" if account_id.nil?\n raise \"name is required\" if name.nil?\n raise \"privacy_level is required\" if privacy_level.nil?\n raise \"consumer_key is required\" if consumer_key.nil?\n raise \"shared_secret is required\" if shared_secret.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :account_id => account_id,\n :name => name,\n :privacy_level => privacy_level,\n :consumer_key => consumer_key,\n :shared_secret => shared_secret\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{account_id}/external_tools\",\n :account_id => account_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n response\n \n end", "def create\n user = User.find_by_email(params[:email])\n if !user.present?\n user = User.create!(user_params)\n user.account_active = false\n user.save!\n accountHash = AccountHash.create(:hashcode => create_hashcode, :user_id => user.id, :password => user.password, :temp_email => nil)\n AppropMailer.account_created(user, accountHash).deliver\n render json: { message: Message.account_created, hashcode: accountHash.hashcode }\n else\n json_response({error: 'El email ya se encuentra registrado en Approp'}, :unprocessable_entity)\n end\n end", "def create\n @heroku_account = Heroku::Account.new(heroku_account_params)\n\n respond_to do |format|\n if @heroku_account.save\n format.html { redirect_to @heroku_account, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @heroku_account }\n else\n format.html { render action: 'new' }\n format.json { render json: @heroku_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_account = UserAccount.new(user_account_params)\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to @user_account, notice: 'User account was successfully created.' }\n format.json { render :show, status: :created, location: @user_account }\n else\n format.html { render :new }\n format.json { render json: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.username, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end", "def create(attributes)\n response = JSON.parse(@client.post('paypal_accounts', attributes).body)\n Promisepay::PaypalAccount.new(@client, response['paypal_accounts'])\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: t('common.created', model: human_name) }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_users(accountId, model) path = \"/api/v2/accounts/#{accountId}/users\"\n post(path, model, {}, AvaTax::VERSION) end", "def create\n @management_account = ManagementAccount.new(management_account_params)\n\n respond_to do |format|\n if @management_account.save\n format.html { redirect_to @management_account, notice: 'Management account was successfully created.' }\n format.json { render json: @management_account, status: :created, location: @management_account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @management_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # authorize @accounts\n @account = Account.new(account_params)\n @account.user_id=current_user.id\n if @account.save\n redirect_to @account, notice: \"Account was successfully created.\" \n else\n render :new\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n next_path = if params[:commit] == \"Kaydet ve Yeni Ekle\"\n new_account_path\n else\n accounts_path\n end\n format.html { redirect_to next_path, notice: 'Hesap oluşturuldu' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def register\n return render :json => 'Invalid email address or password', status: 401 unless params[:email_address]\n existing_treater_account = TreaterAccount.find_by_email_address(params[:email])\n existing_user = existing_treater_account ? existing_treater_account.user : nil\n\n if existing_user.nil? && existing_treater_account.nil?\n #TODO - Fix attr_accessible white list so we dont' have to build this manually...\n user = User.create(email_address: params[:email], name: params[:name],\n password: params[:password], password_confirmation: params[:password_confirmation])\n treater_account = TreaterAccount.create(user_id: user.id, identifier: user.id, name: params[:name], email: user.email_address, authenticated_at: Time.now)\n user.account_setup\n\n session[:user_id] = user.id\n session[:external_account_id] = treater_account.id\n\n result = {}\n result[:on_complete_url] = params[:on_complete_url]\n return render :json => result.to_json, status: 200\n elsif existing_user && existing_treater_account.nil?\n #TODO - Fix attr_accessible white list so we dont' have to build this manually...\n # - Move all this logic to account_setup\n treater_account = TreaterAccount.create(user_id: existing_user.id, identifier: existing_user.id, name: params[:name], email: existing_user.email_address, authenticated_at: Time.now)\n\n session[:user_id] = existing_user.id\n session[:external_account_id] = treater_account.id\n\n result = {}\n result[:on_complete_url] = params[:on_complete_url]\n return render :json => result.to_json, status: 200\n else\n #login failed\n return render :json => 'Some error...', status: 401\n end\n end", "def create\n @account = Account.new(name: account_params[:name])\n \n respond_to do |format|\n if @account.save\n user = @account.users.build(account_params[:users_attributes])\n if user.save\n session[:user_id] = user.id\n format.html { redirect_to samples_path, notice: 'account was successfully created.' }\n format.json { render samples_path, status: :created, location: @account }\n else\n format.html { redirect_to register_path, notice: 'Error, in user save' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new, notice: 'Error, in account save' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(attributes)\n response = JSON.parse(@client.post('bank_accounts', attributes).body)\n Promisepay::BankAccount.new(@client, response['bank_accounts'])\n end", "def create(attributes)\n response = JSON.parse(@client.post('bank_accounts', attributes).body)\n Promisepay::BankAccount.new(@client, response['bank_accounts'])\n end", "def create\n user = User.create!(user_params)\n response = { message: Message.account_created }\n json_response(response, :created)\n end", "def create\n @user_account_app = User.new(params[:user_account_app])\n\n respond_to do |format|\n if @user_account_app.save\n format.html { redirect_to @user_account_app, notice: 'User account app was successfully created.' }\n format.json { render json: @user_account_app, status: :created, location: @user_account_app }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_account_app.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = @project.accounts.build(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n @record = [@project, @account]\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n response = UserAccount::Create.call(user_account_params)\n if response.success?\n success_response(message: response.status_message, http_status: 202, data: response.data)\n else\n error_response(message: response.status_message, data: response.data)\n end\n end", "def create\n @t_user_account = TUserAccount.new(t_user_account_params)\n\n respond_to do |format|\n if @t_user_account.save\n format.html { redirect_to @t_user_account, notice: 'T user account was successfully created.' }\n format.json { render :show, status: :created, location: @t_user_account }\n else\n format.html { render :new }\n format.json { render json: @t_user_account.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.69657475", "0.6878102", "0.65119225", "0.6469372", "0.6435222", "0.613894", "0.6093869", "0.60785115", "0.6018403", "0.6013775", "0.594479", "0.59259516", "0.5910427", "0.58811086", "0.586852", "0.5812276", "0.5800599", "0.5793748", "0.5776442", "0.57460445", "0.57443756", "0.5742743", "0.57353634", "0.5734743", "0.57301295", "0.57241964", "0.57227683", "0.5712734", "0.57028323", "0.5696704", "0.5694651", "0.56747365", "0.56677276", "0.56644416", "0.56510395", "0.5643706", "0.5628797", "0.56205344", "0.5619066", "0.5617732", "0.56089693", "0.55926776", "0.55837965", "0.5580501", "0.55661553", "0.5559207", "0.5558637", "0.555466", "0.5542074", "0.55394125", "0.5537316", "0.55226177", "0.551849", "0.55173266", "0.5512579", "0.5499939", "0.548937", "0.5487695", "0.5485825", "0.54708916", "0.54622066", "0.54593", "0.5458566", "0.5451175", "0.5445318", "0.5439836", "0.54384893", "0.5424426", "0.5401829", "0.53939295", "0.5378623", "0.5376807", "0.53630614", "0.53630614", "0.53630614", "0.5359426", "0.5356004", "0.5351561", "0.533763", "0.53307056", "0.5330141", "0.5328021", "0.5327109", "0.53268594", "0.53223556", "0.53214765", "0.5320986", "0.5318504", "0.5317507", "0.5316069", "0.5314364", "0.53124017", "0.5304213", "0.5297526", "0.5297526", "0.5295063", "0.5293997", "0.52922195", "0.52917594", "0.52911985" ]
0.692325
1
PATCH/PUT /system/platform_accounts/1 PATCH/PUT /system/platform_accounts/1.json
def update if @system_platform_account.update(system_platform_account_params) record_activities('修改接入账号', @system_platform_account.account_name) flash[:success] = '修改接入账号成功' redirect_to system_platform_accounts_path else flash[:error] = "修改失败: #{@system_platform_account.errors.full_message}" render :edit end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @platform_account.update(platform_account_params)\n format.html { redirect_to @platform_account, notice: 'Platform account was successfully updated.' }\n format.json { render :show, status: :ok, location: @platform_account }\n else\n format.html { render :edit }\n format.json { render json: @platform_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n account = current_organization.accounts.find(params[:id])\n return forbidden unless account && current_account.allowed_to_edit_account?(account, current_organization)\n return json(account) unless account.update_attributes pick(params, :first_name, :last_name, :email,:language, :document_language)\n\n role = pick(params, :role)\n #account.update_attributes(role) if !role.empty? && current_account.admin?\n membership = current_organization.role_of(account)\n membership.update_attributes(role) if !role.empty? && current_account.admin?\n password = pick(params, :password)[:password]\n if (current_account.id == account.id) && password\n account.update(password: password)\n end\n json account.canonical(membership: membership)\n end", "def update\n respond_to do |format|\n if @platform_account_type.update(platform_account_type_params)\n format.html { redirect_to @platform_account_type, notice: 'Platform account type was successfully updated.' }\n format.json { render :show, status: :ok, location: @platform_account_type }\n else\n format.html { render :edit }\n format.json { render json: @platform_account_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update \n begin\n @resource = Account.find(params[:id])\n @resource.update_attributes!(params[:account])\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def update\n respond_to do |format|\n if @api_v1_account.update(api_v1_account_params)\n format.html { redirect_to @api_v1_account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_account }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_current_logged_in_users_password(args = {}) \n put(\"/users.json/current/password\", args)\nend", "def update\n\t\t\t\ttoken = params[:auth_token]\n\t\t\t\tid = params[:id].to_i\n\n\t\t\t\tif token.nil?\n\t\t\t\t\trender :status => 400,\n\t\t\t\t\t\t:json => { :message => \"The request must contain an auth token.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\t@user = User.find_by_authentication_token(token)\n\t\t\t\taccount = JSON.parse params[:account]\n\n\t\t\t\tif account[\"username\"].nil?\n\t\t\t\t\trender :status => 400,\n\t\t\t\t\t\t:json => { :message => \"'username' cannot be null.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\tif account[\"computer_id\"].nil?\n\t\t\t\t\trender :status => 400,\n\t\t\t\t\t\t:json => { :message => \"The request must contain a 'computer_id'.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\t@accounts = Account.where computer_id: @user.computer_ids\n\t\t\t\tif id != 0\n\t\t\t\t\tunless @accounts.pluck(:id).include? id\n\t\t\t\t\t\trender :status => 401,\n\t\t\t\t\t\t\t:json => { :message => \"Access Denied, check account Id.\"}\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tputs \n\t\t\t\tputs account\n\t\t\t\tputs \n\t\t\t\tputs account[\"account_process_attrubutes\"]\n\t\t\t\tputs \n\t\t\t\tputs \n\t\t\t\t@account = Account.find(id)\n\t\t\t\tif Account.update(id, account)\n\t\t\t\t\trender json: {account: @account}\n\t\t\t\telse\n\t\t\t\t\trender :json => { :message => \"Something went wrong with saving the entity.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend", "def test_update\n #Again the delete feature from ActiveResource does not work out of the box.\n #Using custom delete function\n puts \"--create a new account--\"\n new_acct = Salesforce::Rest::Account.new(:Name => \"test numero uno\", :BillingStreet=> \"Fairway Meadows\",\n :BillingState => \"NY\", :ShippingCity => \"New York\")\n resp = new_acct.save()\n\n assert (resp.code == 201)\n j = ActiveSupport::JSON\n @sf_oid = j.decode(resp.body)[\"id\"]\n puts \"New Object created: id -> \" + @sf_oid\n\n puts \"--update that new account--\"\n serialized_json = '{\"BillingState\":\"WA\"}'\n #http = Net::HTTP.new(@rest_svr_url, 443)\n http = Net::HTTP.new('na7.salesforce.com', 443)\n http.use_ssl = true\n \n class_name = \"Account\"\n path = \"/services/data/v21.0/sobjects/#{class_name}/#{@sf_oid}\"\n headers = {\n 'Authorization' => \"OAuth \"+ @oauth_token,\n \"content-Type\" => 'application/json',\n }\n code = serialized_json\n\n \n req = Net::HTTPGenericRequest.new(\"PATCH\", true, true, path, headers)\n\n resp = http.request(req, code) { |response| }\n assert !resp.nil?\n\n puts resp.to_s\n end", "def update\n authorize @account\n if @account.update(account_params)\n render json: { status: :ok, account: @account }\n else\n render json: {error: @account.errors, status: :unprocessable_entity }\n end\n end", "def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def update_users_password(args = {}) \n put(\"/users.json/backoffice/#{args[:userId]}/password/#{args[:password]}\", args)\nend", "def update\n @account = current_user.person.blackberry_accounts.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:blackberry_account])\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @company = Company.find(id_from_params)\n\n respond_to do |format|\n if @company.accounts.exists? current_user.account.id\n @company.accounts.delete(current_user.account)\n @company.accounts << current_user.account\n\n format.html { redirect_to root_path, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n @company.accounts << current_user.account\n format.html { redirect_to root_path, notice: 'Company was successfully updated.' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @core_account.update(core_account_params)\n format.html { redirect_to @core_account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @core_account }\n else\n format.html { render :edit }\n format.json { render json: @core_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_system_platform_account\n @system_platform_account = System::PlatformAccount.find(params[:id])\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to quick_launch_path, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_resource(resource, params)\n resource.role_id = 1\n resource.update_without_password(params)\n end", "def set_api_v2_account\n # @account = MasterData::Account.find(params[:id])\n @account = MasterData::Account.find_by(uuid: params[:uuid])\n not_found unless @account\n end", "def update\n unless User.admin_by_token?(request.cookies[\"token\"])\n render json: { error: \"invalid_token\" }, status: :unauthorized\n return\n end\n\n if @resource.update(resource_params)\n render json: @resource, status: :ok\n else\n render json: @resource.errors, status: :unprocessable_entity\n end\n end", "def update_account(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n account = find_account(accounts, options[:email])\n if !account.nil?\n if !options[:firstname].nil?\n account.given_name = options[:firstname]\n end\n if !options[:surname].nil?\n account.surname = options[:surname]\n end\n if !options[:username].nil?\n account.username = options[:username]\n end \n if !options[:password].nil?\n account.password = options[:password]\n end\n if !options[:status].nil?\n account.status = (options[:status] == \"disabled\" ? Stormpath::Resource::Status::DISABLED : Stormpath::Resource::Status::ENABLED)\n end\n\n begin\n account.save\n puts \"Account updated.\"\n rescue Stormpath::Error => e\n print_error(e)\n end\n else\n puts \"Account not found\"\n return\n end\nend", "def update_profile(body={})\n perform_post(\"/account/update_profile.json\", :body => body)\nend", "def update\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(user_id: user[\"id\"], id: params[:id])\n \n if ( account == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n if account.update(account_params)\n render json: account, status: :ok\n else\n render json: account.errors, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def update\n @account = current_user.person.iphone_accounts.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:iphone_account])\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n @account = Account.find(params[:id])\r\n @family_types = FamilyType.all\r\n @family_type = FamilyType.find(params[:family_type])\r\n @account.family_type = @family_type\r\n\r\n\r\n respond_to do |format|\r\n\r\n # If the current account is an admin user but not the account that is being modified,\r\n # they will not have entered a password and we should just assign the current password values\r\n # to the account.\r\n\r\n if current_account == @account\r\n @account.updating_password = true\r\n end\r\n\r\n logger.debug \"Token 1: #{@account.remember_token}\"\r\n\r\n if @account.update_attributes(params[:account])\r\n logger.debug \"Token 2: #{@account.remember_token}\"\r\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\r\n\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @account.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n current_account.update(provider_params, without_protection: true)\n respond_with current_account\n end", "def update_current_logged_in_users_password(args = {}) \n id = args['id']\n temp_path = \"/users.json/current/password\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"userId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n data = tenant_update_params\n tookan = {\"api_key\": \"50646180f541481e4c422b614c5825431be3c2f82fd57936541c03\",\"customer_id\": @tenant.customer_id,\"user_type\": 0,\"name\": data[:name],\"phone\": data[:phone1],\"email\": data[:email],\"address\": data[:address],\"latitude\": data[:latitude],\"longitude\": data[:longitude]}\n response = RestClient.post \"https://api.tookanapp.com/v2/customer/edit\", tookan.to_json, :content_type => \"application/json\"\n response = JSON.parse(response)\n respond_to do |format|\n if response[\"status\"] == 200\n if @tenant.update(tenant_update_params)\n food_category = FoodCategory.find_or_create_by(name: \"Veg\")\n @tenant.tenant_details.update(food_category_id: food_category.id)\n if @tenant.active == true\n end\n end\n @tenant.update(:updated_by=>session[:kitchen_user_id])\n format.html { redirect_to tenants_url, notice: 'Tenant was successfully updated.' }\n format.json { render :show, status: :ok, location: @tenant }\n else\n format.html { redirect_to tenants_url, notice: 'Tenant was not updated.' }\n format.json { render json: @tenant.errors, status: :unprocessable_entity }\n end\n end\nend", "def set_platform_account\n @platform_account = PlatformAccount.find(params[:id])\n end", "def update_resource(resource, params)\n # if params['email'] != current_user.email || params['password'].present?\n # resource.update_with_password(params)\n # else\n resource.update_without_password(params.except('password', 'password_confirmation', 'current_password'))\n # end\n end", "def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend", "def update\n respond_to do |format|\n if @platform.set(platform_params)\n format.html { redirect_to :back, notice: 'Platform was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @platform.update(platform_params)\n format.html { redirect_to [:admin, @platform], notice: 'Platform was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @enable_custom_service_account = args[:enable_custom_service_account] if args.key?(:enable_custom_service_account)\n @service_account = args[:service_account] if args.key?(:service_account)\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update_resource(resource, params)\n if [\"facebook\", \"github\", \"google_oauth2\"].include? current_user.provider\n params.delete(\"email\")\n params.delete(\"avatar\")\n resource.update_without_password(params)\n else\n resource.update_with_password(params)\n end\n end", "def update\n respond_to do |format|\n if @oauth_account.update(oauth_account_params)\n format.html { redirect_to @oauth_account, notice: 'Oauth account was successfully updated.' }\n format.json { render :show, status: :ok, location: @oauth_account }\n else\n format.html { render :edit }\n format.json { render json: @oauth_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @company_account = CompanyAccount.find(params[:id])\n\n respond_to do |format|\n if @company_account.update_attributes(params[:company_account])\n format.html { redirect_to @company_account, :notice => 'Company account was successfully updated.' }\n # format.json { head :ok }\n format.json {render :json => {:data => @company_account , :success => true } }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @company_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\n begin\n\n update_zone = false\n deploy_zone = false\n\n @account = Account.active.find_by_email(params[:id])\n @account = Account.active.find(params[:id]) if @account.nil?\n\n if @account_user.instance_of?(Account)\n #verify user is accessing his/her own account\n raise \"Username '#{@account_user.email}' does not have access to this account\" if @account != @account_user\n end\n\n Account.transaction do\n\n #changed from \"update_attributes\" because\n # - not all attributes can be updated\n # - params may contain one or more (might not be all) attributes\n # - super-user can change attrs that user cannot\n @account[:name] = params[:name] unless params[:name].nil?\n @account[:first_name] = params[:first_name] unless params[:first_name].nil?\n @account[:last_name] = params[:last_name] unless params[:last_name].nil?\n @account[:address] = params[:address] unless params[:address].nil?\n @account[:city] = params[:city] unless params[:city].nil?\n @account[:province] = params[:province] unless params[:province].nil?\n @account[:country] = params[:country] unless params[:country].nil?\n @account[:postal_code] = params[:postal_code] unless params[:postal_code].nil?\n @account[:phone] = params[:phone] unless params[:phone].nil?\n\n #Change password?\n unless (params[:password].nil? || params[:new_password].nil?)\n raise Exceptions::InvalidCredentials.new(@account.email) unless @account.verify_password(params[:password])\n @account[:password] = params[:new_password]\n @account[:status] = VersaFile::AccountStates.Enabled\n end\n\n #Allow super-user to modify these\n if @account_user.instance_of?(RkoUser)\n @account[:customer_code] = params[:customer_code] unless params[:customer_code].nil?\n @account[:billing_type] = params[:billing_type] unless params[:billing_type].nil?\n @account[:account_type] = params[:account_type] unless params[:account_type].nil?\n @account[:trial_period] = ((@account[:account_type] == VersaFile::AccountTypes.Trial) ? params[:trial_period] : VersaFile::TrialStates.NoTrial) unless params[:trial_period].nil?\n\n deploy_zone = ( (!@account.customer_code.nil?) && (@account.customer_code_changed?) && (@account.status == VersaFile::AccountStates.Pending))\n end\n\n @account[:updated_by] = @account_user.instance_of?(RkoUser) ? @account_user.name : @account_user.email\n\n update_zone |= @account.trial_period_changed?\n unless @account.save\n raise_errors(@account.errors)\n end\n\n unless params[:subdomains].nil?\n\n params[:subdomains].each do |subdomain|\n @zone_node = @account.zone_nodes.find_by_subdomain(subdomain[:name])\n raise \"Zone '#{subdomain[:name]}' is not associated with account '#{@account.name}'\" if @zone_node.nil?\n\n @zone_node.name = @account.name unless @account.name.nil?\n @zone_node.max_users = subdomain[:user_quota] unless subdomain[:user_quota].nil?\n @zone_node.max_disk_space = (subdomain[:disk_quota].to_i * VersaFile::DiskSizes.Gigabyte) unless subdomain[:disk_quota].nil?\n\n update_zone |= @account.name_changed? |\n @zone_node.max_users_changed? |\n @zone_node.max_disk_space_changed?\n\n unless @zone_node.save\n raise_errors(@zone_node.errors)\n end\n end\n\n end\n\n #Update remote zone information\n logger.debug(\"UPDATE ZONE???? :> #{update_zone}\")\n if update_zone\n @account.zone_nodes.each do |zone_node|\n zone_node.delay.zone_update\n end\n end\n\n end\n\n if deploy_zone\n @account.zone_nodes.each do |zn|\n #Auto-deploy\n zn.delay.zone_deploy if deploy_zone\n end\n end\n\n respond_to do |format|\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account.to_json(:except=>:password, :methods => [:subdomains, :template]), :status => :ok }\n end\n\n rescue => e\n logger.error \"Account update failed => #{e.message}\"\n respond_to do |format|\n format.json { render :json => e.message, :status => :unprocessable_entity }\n end\n end\n\n end", "def update\n # this action is not provided for partyroles\n end", "def system_platform_account_params\n params[:system_platform_account].except(:id).permit!\n end", "def update\n self.resource = resource_class.to_adapter.get!(send(:\"current_#{resource_name}\").to_key)\n prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)\n resource.reset_authentication_token\n \n updated = if needs_password?(resource, params)\n if params[:user][:date_of_birth].present?\n params[:user][:date_of_birth] = frame_date_of_birth_to_date_format(params[:user][:date_of_birth].to_s)\n if params[:user][:date_of_birth] != nil\n resource.update_with_password(account_update_params)\n else\n render json: {errors: [\"Date format not correct.\"]}, status: :unprocessable_entity and return\n end\n else\n resource.update_with_password(account_update_params)\n end\n else\n params[:user].delete(:current_password)\n if params[:user][:date_of_birth].present?\n params[:user][:date_of_birth] = frame_date_of_birth_to_date_format(params[:user][:date_of_birth].to_s)\n if params[:user][:date_of_birth] != nil\n resource.update_without_password(account_update_params)\n else\n render json: {errors: [\"Date format not correct.\"]}, status: :unprocessable_entity and return\n end\n else\n resource.update_without_password(account_update_params)\n end\n end\n\n if updated\n sign_in resource_name, resource, :bypass => true\n render json: {\n auth_token: resource.authentication_token,\n user_role: resource.role,\n registration_complete: resource.registration_complete?\n }, status: :ok\n else\n clean_up_passwords resource\n render json: {errors: resource.errors.full_messages}, status: :unprocessable_entity\n end\n\n end", "def update\n head :unauthorized\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(object, attrs)\n object.update_with_password(*attrs)\n end", "def update\n respond_to do |format|\n if @inc_stable_account.update(inc_stable_account_params)\n format.html { redirect_to @inc_stable_account, notice: 'Inc stable account was successfully updated.' }\n format.json { render :show, status: :ok, location: @inc_stable_account }\n else\n format.html { render :edit }\n format.json { render json: @inc_stable_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_update\n\n platform = Platform.find(platforms(:flex).id)\n platform.name = 'Yugo'\n\n get(:update, { :platform => platform.attributes }, cathy_admin_session)\n assert_equal('Platform was successfully updated.', flash['notice'])\n assert_redirected_to(:action => 'edit', :id => platform.id)\n assert_equal('Yugo', platform.name)\n end", "def update\n # @user = User.find(params[:id])\n @user = current_user # makes our views \"cleaner\" and more consistent\n params[:user][:existing_identity_attrs] ||= {}\n unless configatron.user_can_change_login\n params[:user].delete(:login)\n @user_login_is_readonly = true\n end\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = \"Account updated!\"\n format.html { redirect_to account_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kakao_account.update(kakao_account_params)\n format.html { redirect_to @kakao_account, notice: 'Kakao account was successfully updated.' }\n format.json { render :show, status: :ok, location: @kakao_account }\n else\n format.html { render :edit }\n format.json { render json: @kakao_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n user = User.find(params[:id])\n if @current_user._id == user._id\n if params[:user][:current_password]\n if @current_user.authenticate(params[:user][:current_password])\n if params[:user][:password] == params[:user][:password_confirmation]\n @current_user.update!(params.require(:user).permit(:password))\n auditLog(@current_user, nil, :UPDATE_COMPANY_USER, \"User: #{@current_user.name}/#{@current_user.email} password updated\")\n render json: { user: @current_user, token: @current_user.auth_token }, methods: [:type, :firstName, :lastName]\n else\n render :json => {error: I18n.t(:passwords_dont_match)}, :status => :bad_request\n end\n else\n render :json => {error: I18n.t(:invalid_pw)}, :status => :bad_request\n end\n else\n\n if @current_user.name != params[:user][:name].to_s || @current_user.email != params[:user][:email].to_s.downcase\n oldName = @current_user.name\n oldEmail = @current_user.email\n @current_user.assign_attributes(params.require(:user).permit(:name, :email))\n if @current_user.valid?\n @current_user.save\n render json: { user: @current_user, token: @current_user.auth_token }, methods: [:type, :firstName, :lastName]\n else\n render :json => {error: \"A user with that email already exists on our system. Please choose another email address.\"}, :status => :bad_request\n end\n else\n render json: { user: @current_user, token: @current_user.auth_token }, methods: [:type, :firstName, :lastName]\n end\n end\n else\n render :json => {error: I18n.t(:invalid_user)}, :status => :unauthorized\n end\n end", "def update\n if @api_v1_user.update(api_v1_user_params)\n head :no_content\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end", "def update\n @account = Account.find(params[:id])\n authorize! :update, @account\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pt_account = current_user.pt_accounts.find(params[:id])\n\n respond_to do |format|\n if @pt_account.update_attributes(params[:pt_account])\n format.html { redirect_to [@pt_account.user, @pt_account], notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pt_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @stack_account.update(stack_account_params)\n format.html { redirect_to @stack_account, notice: 'Stack account was successfully updated.' }\n format.json { render :show, status: :ok, location: @stack_account }\n else\n format.html { render :edit }\n format.json { render json: @stack_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @account_type\n respond_to do |format|\n if @account_type.update(account_type_params)\n format.html { redirect_to @account_type, notice: 'Account type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @account_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @personal_account = PersonalAccount.find(params[:id])\n\n respond_to do |format|\n if @personal_account.update_attributes(params[:personal_account])\n format.html { redirect_to @personal_account, :notice => 'Personal account was successfully updated.' }\n # format.json { head :ok }\n format.json {render :json => {:data => @personal_account , :success => true } }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @personal_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(username, password, id, new_asset_obj)\n raise NotImplementedError, \"Not implemented\"\n end", "def update_resource(resource, params)\n if params[\"password\"]&.present? or params[\"email\"]&.present?\n return super\n else\n resource.update_without_password(params.except(\"current_password\"))\n end\n end", "def update\n @user_account_app = User.find(params[:id])\n\n respond_to do |format|\n if @user_account_app.update_attributes(params[:user_account_app])\n format.html { redirect_to @user_account_app, notice: 'User account app was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_account_app.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(args)\n builder.update_rest(type, ref, args, username, password)\n self.elements(true)\n end", "def update\n authorize @account, :edit?\n respond_to do |format|\n if @account.update_aliases(@aliases) &&\n @account.update(account_params_with_author)\n # keep @account.save at the end of the condition bellow to ensure the right object is returned during rendering\n\n format.html do\n render :show, notice: \"Account was successfully updated.\"\n end\n format.json do\n render json: @account, status: :ok, location: :api_v2_account\n end\n else\n format.html { render :edit }\n format.json do\n render json: @account.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update_resource(resource, params)\n # abort params.inspect\n resource.update_without_password(params)\n end", "def update\n respond_to do |format|\n if @platform.update(platform_params)\n format.html { redirect_to @platform, notice: 'Platform was successfully updated.' }\n format.json { render :show, status: :ok, location: @platform }\n else\n format.html { render :edit }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n response = @account_api.update(params)\n\n respond_to do |format|\n if response[:status] == 200\n format.html { redirect_to accounts_path , notice: 'Account successfully updated.' }\n format.json { render :show, status: :created, location: user_path(response[:body]) }\n else\n format.html { redirect_to edit_account_path(params[:id]), alert: formatted_error_message(response).join(\"<br/>\").html_safe }\n format.json { render json: response[:body], status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @git_hub_account.update(git_hub_account_params)\n format.html { redirect_to @git_hub_account, notice: 'Git hub account was successfully updated.' }\n format.json { render :show, status: :ok, location: @git_hub_account }\n else\n format.html { render :edit }\n format.json { render json: @git_hub_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def configure_update_params\n allow_params(:account_update)\n end", "def update\n @account.user_updated_id = current_user.id\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to accounts_path, notice: I18n.t('account.controller.update') }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_resource.update(api_v1_resource_params)\n format.html { redirect_to @api_v1_resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_resource }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @current_account.update(current_account_params)\n format.html { redirect_to @current_account, flash: { success: \"AccountPayable was successfully updated.\" } }\n format.json { render :show, status: :ok, location: @current_account }\n else\n format.html { render :edit }\n format.json { render json: @current_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @customer\n update_customer_params = ( current_user.role == 'kanari_admin' ? admin_customer_params : customer_params)\n if @customer.update(update_customer_params)\n render json: nil, status: 200\n else\n render json: @customer.errors, status: :unprocessable_entity\n end\n end", "def update_resource(resource, params)\n resource.update_without_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update_resource(resource, params)\n resource.update_with_password(params)\n end", "def update\n set_action(:update)\n set_account_type\n validate_account_type!\n assign_params\n set_affiliate\n set_updated_by\n\n after_update\n account\n end", "def update!(**args)\n @p4_service_accounts = args[:p4_service_accounts] if args.key?(:p4_service_accounts)\n @tenant_project_resources = args[:tenant_project_resources] if args.key?(:tenant_project_resources)\n end", "def update_account(options)\n password = options[:new_password]\n parameters = { :curpass => options[:current_password], :email => options[:email], :newpass => password, :verpass => password, :api_type => :json }\n\n post('api/update', parameters)\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: t('common.updated', model: human_name) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @admin_system_admin\n respond_to do |format|\n if @admin_system_admin.update(admin_system_admin_params)\n format.html { redirect_to @admin_system_admin, notice: 'System admin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_system_admin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, :notice => 'Account was successfully updated.' }\n format.json { head :ok }\n else\n @suppliers = Supplier.all(:order=>:name).collect{|c| [c.name, c.id]}\n @aircraft_types = AircraftType.all(:order => :name).collect{|c| [c.name, c.id]}\n\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @accounts = args[:accounts] if args.key?(:accounts)\n end", "def update!\n @authorize = nil\n update_plan! &&\n resp = put(\"/users/#{username}.xml\", {\n :user_key => apikey,\n \"user[first_name]\" => first_name,\n \"user[last_name]\" => last_name\n })\n end", "def update\n self.resource = resource_class.to_adapter.get!(send(:\"current_resource_owner\").to_key)\n prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)\n\n resource_updated = update_resource(resource, configure_account_update_params)\n yield resource if block_given?\n\n if params[:additional_emails].present?\n resource.additional_emails.destroy_all\n additional_emails = []\n params[:additional_emails].each do |email|\n additional_emails << {email: email}\n end\n end\n \n if resource_updated\n\n resource.additional_emails.create(additional_emails) if params[:additional_emails].present?\n avatar = url_for(resource.avatar) if resource.avatar.attached?\n\n # set_flash_message_for_update(resource, prev_unconfirmed_email)\n bypass_sign_in resource, scope: resource_name #if sign_in_after_change_password?\n respond_to do |format|\n format.json { \n render json: resource.as_json.merge(additional_emails: resource.additional_emails.pluck(:email)).merge(avatar: avatar) # , location: after_sign_up_path_for(resource)\n }\n format.html {respond_with resource, location: after_update_path_for(resource)}\n end\n else\n clean_up_passwords resource\n set_minimum_password_length\n respond_to do |format|\n format.json { render json: { error_messages: resource.errors.full_messages.join(', ') }, status: 422 }\n format.html {respond_with resource}\n end\n end\n end", "def update\n respond_to do |format|\n if @current_account.update(current_account_params)\n format.html { redirect_to @current_account, notice: 'Current account was successfully updated.' }\n format.json { render :show, status: :ok, location: @current_account }\n else\n format.html { render :edit }\n format.json { render json: @current_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end", "def update!(**args)\n @basic_auth = args[:basic_auth] if args.key?(:basic_auth)\n @service_account = args[:service_account] if args.key?(:service_account)\n @use_project_default = args[:use_project_default] if args.key?(:use_project_default)\n end", "def update\n authorize! :update, CompetenceTierGroup\n \n @competence_tier_group.update!(competence_tier_group_params)\n render json: {status: :ok}\n end" ]
[ "0.6664587", "0.63509876", "0.62742865", "0.6177907", "0.61456203", "0.61348855", "0.6080994", "0.60676354", "0.5990541", "0.5987726", "0.5969116", "0.59688026", "0.5911257", "0.5911257", "0.5896474", "0.5860513", "0.58026594", "0.5790808", "0.57885647", "0.57713467", "0.5769689", "0.57576257", "0.5752738", "0.5745562", "0.57412857", "0.56969833", "0.5694296", "0.56881326", "0.5681903", "0.5675648", "0.5671884", "0.56660634", "0.5664516", "0.5653141", "0.56463164", "0.56455326", "0.56206495", "0.5612886", "0.5609091", "0.5596203", "0.558543", "0.55734295", "0.5570199", "0.5549005", "0.5544537", "0.5538347", "0.5538347", "0.5538347", "0.5538347", "0.5538347", "0.5538347", "0.5538347", "0.5538347", "0.5530222", "0.55156577", "0.55130947", "0.55070853", "0.55042267", "0.5501461", "0.5496532", "0.5487757", "0.54874164", "0.5484976", "0.5482808", "0.54824483", "0.5481027", "0.5477673", "0.54763585", "0.5476177", "0.54740393", "0.54706573", "0.54688203", "0.5468568", "0.5466039", "0.5465739", "0.5462203", "0.54616654", "0.54572165", "0.545623", "0.54554594", "0.544865", "0.544865", "0.544865", "0.544865", "0.544865", "0.544865", "0.544865", "0.54448724", "0.54376173", "0.5437048", "0.5435571", "0.54328614", "0.5420873", "0.5416094", "0.54134536", "0.54126745", "0.5412596", "0.54068094", "0.5400825", "0.5387161" ]
0.65516
1
DELETE /system/platform_accounts/1 DELETE /system/platform_accounts/1.json
def destroy if @system_platform_account.destroy record_activities('删除接入账号', @system_platform_account.account_name) flash[:success] = '删除接入账号成功' else flash[:error] = "删除失败: #{@system_platform_account.errors.full_message}" end redirect_to system_platform_accounts_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @platform_account.destroy\n respond_to do |format|\n format.html { redirect_to platform_accounts_url, notice: 'Platform account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end", "def delete_accounts\n end", "def delete_account\n @connection.request({\n :method => 'DELETE'\n })\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend", "def destroy\n @platform_account_type.destroy\n respond_to do |format|\n format.html { redirect_to platform_account_types_url, notice: 'Platform account type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_account.destroy\n respond_to do |format|\n format.html { redirect_to core_accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_account.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account = current_user.person.blackberry_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @company = Company.find(id_from_params)\n @company.accounts.delete(current_user.account)\n #current_user.companies.delete(@company)\n #@company.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete_storage_account(name)\n Loggerx.info \"Deleting Storage Account #{name}.\"\n request_path = \"/services/storageservices/#{name}\"\n request = ManagementHttpRequest.new(:delete, request_path)\n request.call\n rescue Exception => e\n e.message\n end", "def destroy\n @account = current_user.person.phone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n current_user.destroy\n json_response({ message: Message.account_deleted }.to_json)\n end", "def destroy\n @account = current_user.person.iphone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @account.destroy\n redirect_to root_path\n end", "def destroy\n @inc_stable_account.destroy\n respond_to do |format|\n format.html { redirect_to inc_stable_accounts_url, notice: 'Inc stable account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!\n resource = RESOURCE % { account_id: account.id, id: id }\n response = Request.new(account.client, :delete, resource).perform\n from_response(response.body[:data])\n end", "def destroy\n @git_hub_account.destroy\n respond_to do |format|\n format.html { redirect_to git_hub_accounts_url, notice: 'Git hub account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n end", "def destroy\n @kakao_account.destroy\n respond_to do |format|\n format.html { redirect_to kakao_accounts_url, notice: 'Kakao account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @management_account = ManagementAccount.get(params[:id])\n @management_account.destroy\n\n respond_to do |format|\n format.html { redirect_to management_accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_account_app = User.find(params[:id])\n @user_account_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_account_apps_url }\n format.json { head :no_content }\n end\n end", "def tenant_delete(tenant_id)\n\t\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/tenants/#{tenant_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = tenant_id\n\t\t end\n\t\t\n\t\tputs \"invoked tenant delete\"\n\tend", "def destroy\n @api_user.destroy\n\n head :no_content\n end", "def destroy\n @personal_account = PersonalAccount.find(params[:id])\n @personal_account.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @oauth_account.destroy\n respond_to do |format|\n format.html { redirect_to oauth_accounts_url, notice: 'Oauth account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = current_user.person.gmail_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n # resource.soft_delete\n # Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)\n # set_flash_message :notice, :destroyed if is_flashing_format?\n # user = User.find_by(:id)\n # user = destroy\n # render :json=> \"You have successfully, deleted your account\", :status=>201\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to admin_accounts_alumnis_path, notice: 'Alumni was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @baka_account.destroy\n respond_to do |format|\n format.html { redirect_to baka_accounts_url, notice: 'Baka account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_accounting_bank_account = Admin::AccountingBankAccount.find(params[:id])\n @admin_accounting_bank_account.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_accounting_bank_accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def destroy\n\n tookan = {\"api_key\": \"50646180f541481e4c422b614c5825431be3c2f82fd57936541c03\", \"customer_id\": @tenant.customer_id}\n response = RestClient.post \"https://api.tookanapp.com/v2/delete_customer\", tookan.to_json, :content_type => \"application/json\"\n response = JSON.parse(response)\n if response[\"status\"] == 200\n \n @tenant.destroy\n respond_to do |format|\n format.html { redirect_to tenants_url, notice: 'Tenant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n \n end", "def destroy\n @synthetic_account.destroy\n respond_to do |format|\n format.html { redirect_to synthetic_accounts_url, notice: 'Synthetic account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def delete_account(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n account = find_account(accounts, options[:email])\n if !account.nil?\n account.delete\n puts \"Account deleted.\"\n else\n puts \"Account not found.\"\n return\n end\nend", "def destroy\n @admin.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end", "def delete\n appctrl_delete( 'User' )\n end", "def destroy\n @account = current_user.person.linked_in_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @admin_account_history.destroy\n respond_to do |format|\n format.html { redirect_to admin_account_histories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @merchant_account_permission.destroy\n respond_to do |format|\n format.html { redirect_to merchant_account_permissions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @company_account = CompanyAccount.find(params[:id])\n @company_account.destroy\n\n respond_to do |format|\n format.html { redirect_to company_accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @heroku_account.destroy\n respond_to do |format|\n format.html { redirect_to heroku_accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to project_accounts_url(@project), notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n authorize! :destroy, @admin_system_admin\n @admin_system_admin.destroy\n respond_to do |format|\n format.html { redirect_to admin_system_admins_url }\n format.json { head :no_content }\n end\n end", "def delete_account(id)\n res = delete(\"/api/v2/accounts/#{id}\")\n res.is_a?(Array) ? res[0] : res\n end", "def destroy\r\n @account = Account.find(params[:id])\r\n @account.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to accounts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\r\n @account = Account.find(params[:id])\r\n @account.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to accounts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @platform.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @tenant_user = TenantUser.find(params[:id])\n @tenant_user.destroy\n\n respond_to do |format|\n format.html { redirect_to tenant_users_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @account_type\n @account_type.destroy\n respond_to do |format|\n format.html { redirect_to account_types_url }\n format.json { head :no_content }\n end\n end", "def delete_account(id)\n delete(\"accounts/#{id}\")\n end", "def delete_sip_account(id)\n @cloudvox_api[\"/phones/#{id}.json\"].delete\n end", "def destroy\n @analytic_account.destroy\n respond_to do |format|\n format.html { redirect_to analytic_accounts_url, notice: 'Analytic account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account = Admin::Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @linked_account = LinkedAccount.find(params[:id])\n @linked_account.destroy\n\n respond_to do |format|\n format.html { redirect_to linked_accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_account_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_account_types_url, notice: 'Account type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def deleteLogin( login_id)\n params = Hash.new\n params['login_id'] = login_id\n return doCurl(\"delete\",\"/login\",params)\n end", "def webhelper_delete_all_apps (username, password, base_url = @base_url)\r\n private_resource = RestClient::Resource.new base_url + \"/api/v1/apps\" , {:user => username , :password => password , :timeout => 30}\r\n response = private_resource.get :accept => :json\r\n json = JSON.parse(response)\r\n json['apps'].each do |i|\r\n url = base_url + i['link']\r\n private_resource = RestClient::Resource.new url , {:user => username , :password => password , :timeout => 30}\r\n response = private_resource.delete \r\n puts response.to_str\r\n end\r\n end", "def delete\n user = getUserByAuthToken(request)\n user.soft_delete\n head :no_content\n end", "def destroy\n @account = current_user.accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: I18n.t('account.controller.destroy') }\n format.json { head :no_content }\n end\n end", "def destroy\n @account_login.destroy\n respond_to do |format|\n format.html { redirect_to account_logins_url, notice: 'Account login was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!\n resource = self.class::RESOURCE % { account_id: account.id, id: id }\n response = Request.new(account.client, :delete, resource).perform\n from_response(response.body[:data])\n end", "def destroy\n @user_account = UserAccount.find(params[:id])\n @user_account.destroy\n\n respond_to do |format|\n format.html { redirect_to user_accounts_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end", "def destroy\n @connected_account = ConnectedAccount.find(params[:id])\n @connected_account.destroy\n\n respond_to do |format|\n format.html { redirect_to connected_accounts_url }\n format.json { head :no_content }\n end\n end", "def delete(id)\n _params = {:id => id}\n return @master.call 'subaccounts/delete', _params\n end", "def destroy\n @om_account = OmAccount.find(params[:id])\n if current_user_or_can?(:manage_users,@om_account)\n @om_account.destroy\n\n respond_to do |format|\n format.html { redirect_to(om_accounts_url) }\n format.xml { head :ok }\n end\n end\n end", "def destroy\n @platform.destroy\n respond_to do |format|\n format.html { redirect_to admin_platforms_url, notice: 'Platform was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user = User.find(params[:id])\n Rauth::Bridge.destroy_account(@user)\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @platform = Platform.find(params[:id])\n @platform.destroy\n\n respond_to do |format|\n format.html { redirect_to platforms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = current_user.accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_accounts_url(current_user)) }\n format.xml { head :ok }\n end\n end", "def destroy\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(user_id: user[\"id\"], id: params[:id])\n \n if ( account == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n\n if account.destroy\n render json: :nothing, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def destroy\n @stack_account.destroy\n respond_to do |format|\n format.html { redirect_to stack_accounts_url, notice: 'Stack account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/customFields/#{id}\")\n end", "def delete\n api(\"Delete\")\n end", "def destroy\n # @credential.destroy\n # respond_to do |format|\n # format.html { redirect_to credentials_url, notice: 'Credential was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end", "def destroy\n @insta_account.destroy\n respond_to do |format|\n format.html { redirect_to insta_accounts_url, notice: 'Insta account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(context, name)\n res = context.transport.delete_request(context, \"security/users/#{name}\")\n\n context.err(name, res.body) unless res.success?\n end" ]
[ "0.72787035", "0.72124016", "0.71362054", "0.7104608", "0.69834447", "0.6962185", "0.6930946", "0.6786673", "0.67275316", "0.6713607", "0.67068356", "0.6480351", "0.6465249", "0.6465249", "0.6465249", "0.6465249", "0.6460519", "0.6445031", "0.64420724", "0.6418994", "0.6412066", "0.63993984", "0.6391774", "0.6383312", "0.6375474", "0.6372748", "0.636829", "0.6354808", "0.63449484", "0.6337747", "0.63263047", "0.632009", "0.6320076", "0.63172877", "0.630694", "0.62904423", "0.6278786", "0.6278786", "0.6278786", "0.6273296", "0.62669766", "0.62624466", "0.62571293", "0.62564135", "0.6252074", "0.62517273", "0.6251109", "0.62489825", "0.6248347", "0.6242605", "0.62316674", "0.6231382", "0.6226197", "0.6218501", "0.62170255", "0.62148327", "0.6204346", "0.6198995", "0.61952496", "0.61952496", "0.61904883", "0.61888415", "0.6187393", "0.6186667", "0.6186064", "0.61842966", "0.6184031", "0.61807436", "0.61807436", "0.61807436", "0.61807436", "0.61807436", "0.61807436", "0.6179361", "0.6179361", "0.6171328", "0.6171252", "0.6169919", "0.6163858", "0.61550045", "0.61495996", "0.6144686", "0.6142641", "0.61424077", "0.61382216", "0.6137638", "0.61364555", "0.6127447", "0.6122055", "0.6120108", "0.6117537", "0.6115645", "0.61149096", "0.61131865", "0.6111772", "0.61116874", "0.6104476", "0.6096395", "0.60958755", "0.6087172" ]
0.693422
6
Use callbacks to share common setup or constraints between actions.
def set_system_platform_account @system_platform_account = System::PlatformAccount.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def system_platform_account_params params[:system_platform_account].except(:id).permit! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_coleta_indicador @coleta_indicador = ColetaIndicador.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def coleta_indicador_params params.require(:coleta_indicador).permit(:indicador_id, :abrangencia_coleta, :area_id, :pessoa_id, :indice, :semestre, :quadrimestre, :trimestre, :mes, :quinzena, :semana, :ano, :periodo_coleta) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
GET /posts GET /posts.xml
def index @posts = Post.search(params[:search], params[:page]) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @posts } format.js format.atom end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @post }\n format.xml { render xml: @posts }\n end\n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml { render xml: @posts }\n end\n end", "def index\n @posts = Post.find(:all, :order=>'created_on DESC')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @posts.to_xml }\n end\n end", "def index\n @posts = Post.find(:all, :order => :created_at)\n\n respond_to do |format|\n format.html # index.rhtml\n# format.xml { render :xml => @posts.to_xml }\n end\n end", "def index\n @posts = Post.find_list(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def feed\r\n @posts = Post.all(:order => \"created_at DESC\")\r\n respond_to do |format|\r\n format.rss\r\n end\r\n end", "def index\n @posts = Post.order(created_at: :desc)\n respond_to do |format|\n format.html { render }\n format.text { render }\n format.xml { render xml: @posts }\n format.json { render json: @posts.to_json }\n end\n end", "def list\r\n @posts = Post.paginate :page => params[:page], :per_page => 24, :order => \"created_at DESC\"\r\n\r\n respond_to do |format|\r\n\r\n format.html # list.html.erb\r\n format.xml { render :xml => @posts }\r\n end\r\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n format.rss { render :layout => false }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def index\n @posts = Post.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts,:layout => false }\n end\n end", "def index\n @posts = Post.published.page(params[:page]).per(5).ordered\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @post.to_xml }\n end\n end", "def index\n @posts = Post.paginate(:page=>params[:page], :order=>'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def list_posts(api_object)\r\n puts \"Current Post:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n contents= doc.xpath('posts/post/content').collect {|e| e.text }\r\n puts contents.join(\", \")\r\n puts \"\"\r\nend", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def index\n @posts = Post.find(:all,:order => 'created_at DESC').paginate(:per_page => 5, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n\t\t@post = Post.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.xml { render:xml => @post}\n\t\tend\n\tend", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.atom\n end\n end", "def show\n @post = Post.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n# format.xml { render :xml => @post.to_xml }\n end\n end", "def index\n @posts = Post.all\n\n @title = \"Blog Management\"\n\n respond_to do |format| \n format.html { render :index }\n format.xml { render :xml => @posts.to_xml}\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end", "def show\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end \n end", "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def index\n respond_with(@posts) do |format|\n format.html do\n return redirect_to blog_path, :status => 301 if request.path =~ /^\\/posts(\\/?)$/ && flash.empty?\n\n @posts = user_signed_in? ? Post.latest : Post.published.latest\n @posts = @posts.paginate :page => params[:page], :per_page => Post.per_page\n end\n\n format.rss { @posts = Post.published.latest }\n end\n end", "def index\n authorize! :read, Post\n @posts = Post.accessible_by(current_ability).order('created_at DESC').paginate(:per_page => 15, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n format.rss { render :layout => false } \n end\n end", "def index\r\n # @posts = Post.all(:order => \"created_at DESC\")\r\n @posts = Post.paginate :page => params[:page], :per_page => 24, :order => \"created_at DESC\"\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @posts }\r\n end\r\n end", "def index\n @title = \"Home\"\n @posts = Post.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n format.json { render :json => @posts }\n format.atom # index.atom.builder\n end\n end", "def index\n # @posts = Post.paginate :page => params[:page]\n @posts = Post.paginate :page => params[:page], :per_page => 2\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def index\n @posts = Post.limit 50\n @title = \"Weblog - last posts\"\n @updated = @posts.first.created_at unless @posts.empty?\n respond_to do |format|\n format.rss do\n redirect_to feeds_path(format: :atom),\n status: :moved_permanently\n end\n format.atom\n end\n end", "def posts(opts)\n response = get(\"posts\", opts)\n response\n end", "def index\n @posts = Mist::Post.recently_published(20, Mist.authorized?(:view_drafts, self))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end", "def show\n @post251 = Post251.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post251 }\n end\n end", "def index\n @posts = Post.order(\"created_at DESC\").where(:published => true).limit(5)\n @title = \"Home\"\n @description = \"the blog and website of bassist and programmer Johnny Grubb. no baseball information here.\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml\n end\n end", "def index\n @posts = if params[:tag]\n Post.tagged_with(params[:tag])\n else\n Post.scoped\n end\n @posts = @posts.where(:published => true).order(\"created_at DESC\")\n @posts = @posts.paginate(:page => params[:page], :per_page => 4) unless params[:count] == \"all\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.rss { render :layout => false }\n format.xml { render :xml => @posts }\n end\n end", "def show\n #render :template => 'posts/show.xml.builder', :layout => false\n render :json => @post, :layout => false\n end", "def show\n @feed = Feed.find(params[:id])\n @posts = @feed.posts.order(\"published desc\").paginate(:page => params[:page], :per_page => 20)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feed }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end", "def show\n provides :xml, :json\n \n @post = Post[params[:id]]\n \n if content_type == :html\n render\n else\n display @post\n end\n end", "def index\n respond_to do |format|\n format.html { \n @posts = Post.search(params[:search_title], params[:search_tags], params[:page])\n }\n \n format.rss { \n @posts = Post.all(:limit => RSS_ITEM_LIMIT, :order => \"created_at DESC\")\n render :layout => false \n }\n\n format.xml { \n @posts = Post.all\n render :xml => @posts\n }\n \n format.json { \n @posts = Post.all\n render :json => @posts\n }\n end\n end", "def index\n\t@posts = list_posts\n end", "def index \n authorize! :read, Post\n @posts = Post.find(:all, :order => \"created_at DESC\")\n respond_to do |format|\n format.html\n format.atom\n end\n\n end", "def rss\n @events = Post.find(:all, {:conditions=> \"status=public\"},:order => \"id DESC\")\n render :layout => false\n headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end", "def show\n @post134 = Post134.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post134 }\n end\n end", "def index\n @posts = PostService.getAllPosts\n end", "def show\n @post125 = Post125.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post125 }\n end\n end", "def show\n @post101 = Post101.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post101 }\n end\n end", "def index\n\n\t\t# GET ALL THE BLOG POSTS\n @posts = Post.find(:all, :limit => 5)\n @downloads = Download.find(:all, :limit => 5, :conditions => {:parent_id => nil})\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post246 = Post246.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post246 }\n end\n end", "def show\n @post78 = Post78.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post78 }\n end\n end", "def show\n @post99 = Post99.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post99 }\n end\n end", "def show\n @post120 = Post120.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post120 }\n end\n end", "def show\n @post57 = Post57.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post57 }\n end\n end", "def index\n if params[:all]\n @posts = Post.all\n elsif\n @posts = Post.tagged_with(\"blog\")\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def index\n @post_categories = PostCategory.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @post_categories }\n end\n end", "def show\n @post181 = Post181.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post181 }\n end\n end", "def index\n @feeds = Feed.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @feeds.to_xml }\n end\n end", "def index\n options = {:page => params[:page] || 1, :per_page => 2}\n @posts = (params[:tag].blank? ? Post.published.search(params[:search], options) : Post.published.paginate_tagged_with(params[:tag], options))\n respond_to do |format|\n format.html{}\n format.xml{ render :xml => @posts }\n end\n end", "def show\n @post253 = Post253.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post253 }\n end\n end", "def show\n @post342 = Post342.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post342 }\n end\n end", "def show\n @post75 = Post75.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post75 }\n end\n end", "def rss\n @headers[\"Content-Type\"] = \"application/xml\"\n @articles = Article.find(:all, \n :order => 'created_at DESC',\n :conditions => [\"articles.approved = ?\", true],\n :limit => 10\n )\n render :layout => false\n end", "def show\n @post81 = Post81.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post81 }\n end\n end", "def show\n @post182 = Post182.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post182 }\n end\n end", "def show\n @post55 = Post55.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post55 }\n end\n end", "def show\n @post77 = Post77.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post77 }\n end\n end", "def show\n @post257 = Post257.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post257 }\n end\n end", "def show\n @post445 = Post445.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post445 }\n end\n end", "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @feed.to_xml }\n end\n end", "def show\n @post66 = Post66.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post66 }\n end\n end", "def show\n @blog_post = BlogPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @blog_post }\n end\n end", "def show\n @post107 = Post107.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post107 }\n end\n end", "def show\n @post321 = Post321.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post321 }\n end\n end", "def show\n @post231 = Post231.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post231 }\n end\n end", "def show\n @post105 = Post105.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post105 }\n end\n end", "def index\n @articles = Article.published\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @articles }\n end\n end", "def index\n # TODO: implement listing all posts\n end", "def index\n @page[:per_page] = params[:limit] || 5\n @blog_posts = BlogPost.order(@order).paginate(@page)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blog_posts, callback: params[:callback] }\n format.xml { render xml: @blog_posts }\n format.rss { render 'feed' }\n end\n end", "def show\n @post109 = Post109.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post109 }\n end\n end", "def show\n @post184 = Post184.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post184 }\n end\n end", "def show\n @post74 = Post74.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post74 }\n end\n end", "def show\n @post117 = Post117.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post117 }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end", "def show\n @post10 = Post10.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post10 }\n end\n end", "def show\n @post = Post.find(params[:id], :include => [:blog, :comments, :user, :tags])\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @post }\n end\n end", "def index\n @posts = Post.all\n @title=\"All LitwakRecommends Posts\"\n\t@metadescription = \"Listing of all Posts for LitwakRecommends travel blog\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end" ]
[ "0.73163414", "0.72102565", "0.72102565", "0.70133805", "0.69922805", "0.69905823", "0.6946224", "0.68449396", "0.6825624", "0.68239427", "0.67839086", "0.67474705", "0.6744808", "0.67014694", "0.66831535", "0.66570085", "0.66536814", "0.6641173", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.6569632", "0.65689623", "0.6562864", "0.6548791", "0.65417695", "0.65400404", "0.6532962", "0.6532095", "0.6509035", "0.6509035", "0.6451045", "0.6432708", "0.6423995", "0.64157194", "0.64118004", "0.6391085", "0.63896364", "0.63731444", "0.63691884", "0.6361821", "0.6360292", "0.63583076", "0.63511515", "0.6342905", "0.6339071", "0.63336664", "0.63287073", "0.6324601", "0.63148195", "0.6311334", "0.6296899", "0.6286889", "0.62864393", "0.62858725", "0.62757164", "0.62744164", "0.6268504", "0.6262129", "0.6247976", "0.6244519", "0.6240205", "0.6239487", "0.6233154", "0.6226862", "0.62248725", "0.6223015", "0.62088597", "0.62063754", "0.6198131", "0.6196574", "0.61905736", "0.6187951", "0.6187811", "0.6174592", "0.617229", "0.6170761", "0.61688745", "0.61672014", "0.6162086", "0.616047", "0.6160359", "0.6157711", "0.6154687", "0.6154447", "0.61543655", "0.61533695", "0.615046", "0.61485565", "0.6146997", "0.6145814", "0.61350554", "0.61348975" ]
0.6194646
78
GET /posts/1 GET /posts/1.xml
def show @post = Post.find_by_id(params[:id]) || Post.find_by_url(params[:id]) if logged_in? @comments = @post.comments.all(:order => "created_at DESC") else @comments = @post.comments.approved(:order => "created_at DESC") end respond_to do |format| format.html # show.html.erb format.xml { render :xml => @post } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @post }\n format.xml { render xml: @posts }\n end\n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def index\n @posts = Post.find(:all, :order=>'created_on DESC')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @posts.to_xml }\n end\n end", "def index\n @posts = Post.find(:all, :order => :created_at)\n\n respond_to do |format|\n format.html # index.rhtml\n# format.xml { render :xml => @posts.to_xml }\n end\n end", "def index\n @posts = Post.find_list(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @post.to_xml }\n end\n end", "def show\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end \n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml { render xml: @posts }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n format.rss { render :layout => false }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def feed\r\n @posts = Post.all(:order => \"created_at DESC\")\r\n respond_to do |format|\r\n format.rss\r\n end\r\n end", "def index\n @posts = Post.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts,:layout => false }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n\t\t@post = Post.find(params[:id])\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.xml { render:xml => @post}\n\t\tend\n\tend", "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n# format.xml { render :xml => @post.to_xml }\n end\n end", "def show\n @post = Post.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post251 = Post251.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post251 }\n end\n end", "def index\n @posts = Post.order(created_at: :desc)\n respond_to do |format|\n format.html { render }\n format.text { render }\n format.xml { render xml: @posts }\n format.json { render json: @posts.to_json }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "def show\n @post101 = Post101.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post101 }\n end\n end", "def index\n @posts = Post.limit 50\n @title = \"Weblog - last posts\"\n @updated = @posts.first.created_at unless @posts.empty?\n respond_to do |format|\n format.rss do\n redirect_to feeds_path(format: :atom),\n status: :moved_permanently\n end\n format.atom\n end\n end", "def index\n @posts = Post.published.page(params[:page]).per(5).ordered\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post257 = Post257.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post257 }\n end\n end", "def index\n @posts = Post.paginate(:page=>params[:page], :order=>'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post134 = Post134.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post134 }\n end\n end", "def show\n @post246 = Post246.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post246 }\n end\n end", "def index\n @posts = Post.find(:all,:order => 'created_at DESC').paginate(:per_page => 5, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post99 = Post99.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post99 }\n end\n end", "def show\n @post57 = Post57.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post57 }\n end\n end", "def show\n @post78 = Post78.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post78 }\n end\n end", "def show\n @post181 = Post181.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post181 }\n end\n end", "def show\n @post253 = Post253.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post253 }\n end\n end", "def list_posts(api_object)\r\n puts \"Current Post:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n contents= doc.xpath('posts/post/content').collect {|e| e.text }\r\n puts contents.join(\", \")\r\n puts \"\"\r\nend", "def list\r\n @posts = Post.paginate :page => params[:page], :per_page => 24, :order => \"created_at DESC\"\r\n\r\n respond_to do |format|\r\n\r\n format.html # list.html.erb\r\n format.xml { render :xml => @posts }\r\n end\r\n end", "def show\n @post342 = Post342.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post342 }\n end\n end", "def show\n @post125 = Post125.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post125 }\n end\n end", "def show\n provides :xml, :json\n \n @post = Post[params[:id]]\n \n if content_type == :html\n render\n else\n display @post\n end\n end", "def index\n\n\t\t# GET ALL THE BLOG POSTS\n @posts = Post.find(:all, :limit => 5)\n @downloads = Download.find(:all, :limit => 5, :conditions => {:parent_id => nil})\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post231 = Post231.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post231 }\n end\n end", "def show\n @post77 = Post77.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post77 }\n end\n end", "def show\n @post75 = Post75.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post75 }\n end\n end", "def index\n @posts = Post.all\n\n @title = \"Blog Management\"\n\n respond_to do |format| \n format.html { render :index }\n format.xml { render :xml => @posts.to_xml}\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end", "def show\n @post321 = Post321.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post321 }\n end\n end", "def show\n @post120 = Post120.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post120 }\n end\n end", "def show\n @post81 = Post81.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post81 }\n end\n end", "def index\n @title = \"Home\"\n @posts = Post.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n format.json { render :json => @posts }\n format.atom # index.atom.builder\n end\n end", "def show\n @post107 = Post107.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post107 }\n end\n end", "def show\n @post182 = Post182.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post182 }\n end\n end", "def show\n @post66 = Post66.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post66 }\n end\n end", "def show\n @post227 = Post227.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post227 }\n end\n end", "def show\n @post105 = Post105.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post105 }\n end\n end", "def show\n @post445 = Post445.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post445 }\n end\n end", "def show\n @post55 = Post55.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post55 }\n end\n end", "def show\n @post117 = Post117.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post117 }\n end\n end", "def show\n @post10 = Post10.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post10 }\n end\n end", "def show\n @post74 = Post74.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post74 }\n end\n end", "def show\n @post109 = Post109.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post109 }\n end\n end", "def show\n @post275 = Post275.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post275 }\n end\n end", "def show\n @post129 = Post129.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post129 }\n end\n end", "def show\n @post273 = Post273.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post273 }\n end\n end", "def show\n @post197 = Post197.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post197 }\n end\n end", "def show\n @post157 = Post157.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post157 }\n end\n end", "def index\n # @posts = Post.paginate :page => params[:page]\n @posts = Post.paginate :page => params[:page], :per_page => 2\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end", "def show\n @post245 = Post245.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post245 }\n end\n end", "def show\n @post483 = Post483.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post483 }\n end\n end", "def show\n @post139 = Post139.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post139 }\n end\n end", "def show\n @post267 = Post267.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post267 }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end", "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.atom\n end\n end", "def show\n @post284 = Post284.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post284 }\n end\n end", "def index\r\n # @posts = Post.all(:order => \"created_at DESC\")\r\n @posts = Post.paginate :page => params[:page], :per_page => 24, :order => \"created_at DESC\"\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @posts }\r\n end\r\n end", "def show\n #render :template => 'posts/show.xml.builder', :layout => false\n render :json => @post, :layout => false\n end", "def show\n @post149 = Post149.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post149 }\n end\n end", "def show\n @post143 = Post143.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post143 }\n end\n end", "def show\n @post54 = Post54.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post54 }\n end\n end", "def show\n @post249 = Post249.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post249 }\n end\n end", "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @feed.to_xml }\n end\n end", "def show\n @post184 = Post184.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post184 }\n end\n end", "def show\n @post110 = Post110.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post110 }\n end\n end", "def index\n respond_with(@posts) do |format|\n format.html do\n return redirect_to blog_path, :status => 301 if request.path =~ /^\\/posts(\\/?)$/ && flash.empty?\n\n @posts = user_signed_in? ? Post.latest : Post.published.latest\n @posts = @posts.paginate :page => params[:page], :per_page => Post.per_page\n end\n\n format.rss { @posts = Post.published.latest }\n end\n end", "def show\n @post = Post.find(params[:id])\n @title = @post.title\n \n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @post.to_xml }\n end\n end", "def show\n @post221 = Post221.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post221 }\n end\n end", "def index\n @posts = Post.order(\"created_at DESC\").where(:published => true).limit(5)\n @title = \"Home\"\n @description = \"the blog and website of bassist and programmer Johnny Grubb. no baseball information here.\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n format.xml\n end\n end", "def show\n @post168 = Post168.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post168 }\n end\n end", "def show\n @post328 = Post328.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post328 }\n end\n end", "def show\n @post85 = Post85.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post85 }\n end\n end", "def show\n @post193 = Post193.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post193 }\n end\n end", "def show\n @post459 = Post459.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post459 }\n end\n end" ]
[ "0.72230846", "0.7073397", "0.7073397", "0.6978713", "0.69539315", "0.69031423", "0.6797454", "0.67764527", "0.67728055", "0.6706541", "0.67029274", "0.66985327", "0.6677388", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.66654295", "0.6663551", "0.6656949", "0.66288304", "0.6618437", "0.66177785", "0.66030884", "0.65995765", "0.65995765", "0.6577797", "0.6566537", "0.65630615", "0.65579927", "0.65578336", "0.6544128", "0.6539112", "0.6530588", "0.65284926", "0.65253115", "0.65229887", "0.65225196", "0.6517227", "0.6515897", "0.65139264", "0.6505048", "0.64923406", "0.6483094", "0.6479985", "0.6479292", "0.64685667", "0.64624375", "0.64611727", "0.6459169", "0.6458951", "0.6454094", "0.6453434", "0.64464176", "0.6445181", "0.6432302", "0.6414653", "0.6414241", "0.64125043", "0.64087236", "0.6407182", "0.6406997", "0.63986886", "0.63946235", "0.63945794", "0.6389463", "0.6386865", "0.6377745", "0.6377232", "0.6374512", "0.63651", "0.635975", "0.63542426", "0.63538253", "0.635154", "0.6347047", "0.6345173", "0.63446015", "0.6344131", "0.6341661", "0.634062", "0.6338945", "0.6338542", "0.63380927", "0.63370776", "0.63336074", "0.6331987", "0.6329106", "0.6328752", "0.6325661", "0.6322075", "0.6314908", "0.63121307", "0.6310085", "0.63082105" ]
0.0
-1
GET /posts/new GET /posts/new.xml
def new @user = User.find(session[:user_id]) @post = @user.posts.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @post } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end", "def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\r\n @post = Post.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @post }\r\n end\r\n end", "def new\r\n @post = Post.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @post }\r\n end\r\n end", "def new\n @posts = Post.find(:all, :order => 'updated_at DESC')\n @post = Post.new\n @post.title = \"Überschrift*\"\n\n respond_to do |format|\n format.html { render :template => \"posts/new\" }\n format.xml { render :xml => @post }\n end\n end", "def new\n @post = Post.new\n\t@posts = Post.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post101 = Post101.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post101 }\n end\n end", "def new\n @post78 = Post78.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post78 }\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n format.xml { render :xml => @post }\n end\n end", "def new\n @post246 = Post246.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post246 }\n end\n end", "def new\n @post197 = Post197.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post197 }\n end\n end", "def new\n @post55 = Post55.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post55 }\n end\n end", "def new\n @post57 = Post57.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post57 }\n end\n end", "def new\n @post125 = Post125.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post125 }\n end\n end", "def new\n @post = Post.new\n @title = \"New Post\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n format.json { render :json => @post }\n end\n end", "def new\n @post253 = Post253.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post253 }\n end\n end", "def new\n @post99 = Post99.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post99 }\n end\n end", "def new\n @post181 = Post181.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post181 }\n end\n end", "def new\n @post120 = Post120.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post120 }\n end\n end", "def new\n @post227 = Post227.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post227 }\n end\n end", "def new\n @post = Post.new\n @publish = false\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n end", "def new\n @post54 = Post54.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post54 }\n end\n end", "def new\n @post342 = Post342.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post342 }\n end\n end", "def new\n @post50 = Post50.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post50 }\n end\n end", "def new\n @post134 = Post134.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post134 }\n end\n end", "def new\n @post275 = Post275.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post275 }\n end\n end", "def new\n @post251 = Post251.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post251 }\n end\n end", "def new\n @post117 = Post117.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post117 }\n end\n end", "def new\n @post321 = Post321.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post321 }\n end\n end", "def new\n @post74 = Post74.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post74 }\n end\n end", "def new\n @post184 = Post184.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post184 }\n end\n end", "def new\n @post328 = Post328.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post328 }\n end\n end", "def new\n @post75 = Post75.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post75 }\n end\n end", "def new\n @post182 = Post182.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post182 }\n end\n end", "def new\n @post445 = Post445.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post445 }\n end\n end", "def new\n @post109 = Post109.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post109 }\n end\n end", "def new\n @post133 = Post133.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post133 }\n end\n end", "def new\n @post110 = Post110.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post110 }\n end\n end", "def new\n @post10 = Post10.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post10 }\n end\n end", "def new\n @post77 = Post77.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post77 }\n end\n end", "def new\n @post156 = Post156.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post156 }\n end\n end", "def new\n @post305 = Post305.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post305 }\n end\n end", "def new\n @post105 = Post105.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post105 }\n end\n end", "def new\n @post168 = Post168.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post168 }\n end\n end", "def new\n @post107 = Post107.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post107 }\n end\n end", "def new\n @post245 = Post245.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post245 }\n end\n end", "def new\n @post143 = Post143.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post143 }\n end\n end", "def new\n @post284 = Post284.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post284 }\n end\n end", "def new\n @post150 = Post150.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post150 }\n end\n end", "def new\n @post196 = Post196.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post196 }\n end\n end", "def new\n @post149 = Post149.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post149 }\n end\n end", "def new\n @post85 = Post85.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post85 }\n end\n end", "def new\n @post139 = Post139.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post139 }\n end\n end", "def new\n @post65 = Post65.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post65 }\n end\n end", "def new\n @post273 = Post273.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post273 }\n end\n end", "def new\n @post295 = Post295.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post295 }\n end\n end", "def new\n @post350 = Post350.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post350 }\n end\n end", "def new\n @post122 = Post122.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post122 }\n end\n end", "def new\n @post306 = Post306.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post306 }\n end\n end", "def new\n @post81 = Post81.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post81 }\n end\n end", "def new\n @post231 = Post231.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post231 }\n end\n end", "def new\n @post183 = Post183.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post183 }\n end\n end", "def new\n @post409 = Post409.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post409 }\n end\n end", "def new\n @post377 = Post377.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post377 }\n end\n end", "def new\n @post483 = Post483.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post483 }\n end\n end", "def new\n @post257 = Post257.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post257 }\n end\n end", "def new\n @post453 = Post453.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post453 }\n end\n end", "def new\n @post267 = Post267.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post267 }\n end\n end", "def new\n @post358 = Post358.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post358 }\n end\n end", "def new\n @post33 = Post33.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post33 }\n end\n end", "def new\n @post193 = Post193.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post193 }\n end\n end", "def new\n @post58 = Post58.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post58 }\n end\n end", "def new\n @post21 = Post21.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post21 }\n end\n end", "def new\n @post129 = Post129.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post129 }\n end\n end", "def new\n @post66 = Post66.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post66 }\n end\n end", "def new\n @post290 = Post290.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post290 }\n end\n end", "def new\n @post41 = Post41.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post41 }\n end\n end", "def new\n @post106 = Post106.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post106 }\n end\n end", "def new\n @post425 = Post425.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post425 }\n end\n end", "def new\n @post59 = Post59.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post59 }\n end\n end" ]
[ "0.78365606", "0.7708412", "0.76752806", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.7665492", "0.76420695", "0.76340854", "0.7567351", "0.7567351", "0.75021523", "0.7495493", "0.74472666", "0.7447242", "0.74021965", "0.7399193", "0.73932934", "0.73880976", "0.73846865", "0.7381505", "0.73672473", "0.73626494", "0.7361229", "0.73511136", "0.73433757", "0.73251563", "0.73185396", "0.73178715", "0.73113936", "0.731135", "0.7310921", "0.7310211", "0.73059136", "0.72991717", "0.72942847", "0.72908795", "0.72849077", "0.7281714", "0.7281635", "0.7280247", "0.72725064", "0.7266951", "0.72652847", "0.7252029", "0.72503525", "0.72498703", "0.7249234", "0.72461545", "0.7245462", "0.72400486", "0.7238213", "0.7234176", "0.72236806", "0.7221183", "0.7220305", "0.72180104", "0.7217864", "0.721566", "0.72096163", "0.7203399", "0.72017276", "0.72002184", "0.71978325", "0.71960825", "0.71959877", "0.71926796", "0.7190176", "0.7186632", "0.71860325", "0.7185198", "0.71838474", "0.71830064", "0.71813864", "0.71792793", "0.71748424", "0.71646976", "0.7164696", "0.71614957", "0.71581435", "0.71568686", "0.7144312", "0.7140119", "0.7138575", "0.7136993", "0.713379", "0.7132396" ]
0.0
-1
POST /posts POST /posts.xml
def create @user = User.find(session[:user_id]) @post = @user.posts.new(params[:post]) respond_to do |format| if @post.save format.html { redirect_to("/#{@post.url}", :notice => t('controller.created')) } format.xml { render :xml => @post, :status => :created, :location => @post } else format.html { render :action => "new" } format.xml { render :xml => @post.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def test_should_create_post_via_API_XML\r\n get \"/logout\"\r\n post \"/forum_posts.xml\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n end", "def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end", "def post(*args)\n request :post, *args\n end", "def post(*args)\n request(:post, *args)\n end", "def post #:doc:\n end", "def post(body)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n\n request = Net::HTTP::Post.new(uri)\n request['Content-Type'] = 'text/xml'\n request['Accept-Language'] = locale if locale\n request.body = body\n\n response = http.request(request)\n\n Response.new(response, uri)\n end", "def post\n resource.post(request, response)\n end", "def post\r\n end", "def post(*args)\n Request.post(*args)\n end", "def create\n @post = Post.new(post_params)\n\n respond_to do |format|\n if @post.save\n format.json { render json: @post, status: :created, location: @post }\n format.xml { render xml: @post, status: :created, location: @post }\n else\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.xml { render xml: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def post\n end", "def create\n respond_with Post.create(params[:posts])\n end", "def create\n\t@posts = Post.all\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(*args)\n prepare_request(:post, args)\n @@client.add(:post, @path, *args)\n end", "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(posts_url) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(params)\n\nxml =<<XML\n<entry xmlns=\"http://purl.org/atom/ns#\">\n <title>#{params[:title]}</title>\n <link rel=\"related\" type=\"text/html\" href=\"#{params[:url]}\" />\n <summary type=\"text/plain\">#{params[:comment]}</summary>\n</entry>\nXML\n\n post('/post', xml)\n end", "def POST; end", "def post(path, **args); end", "def post\n doc = Nokogiri::XML(request.body)\n id= (doc/'id').text\n # p = Post.exists?(id) ? Post.find(id) : Post.new\n p= Post.find_or_create_by_intranet_id id\n p.update_attributes :subject => (doc/'subject').text,\n :body => (doc/'body').text, :post_type => (doc/'post-type').text,\n :pic => (doc/'pic') .text, :begin_on=>(doc/'begin-on').text,\n :pic_postimg => (doc/'pic-postimg').text,\n :video => (doc/'video').text, \n :end_on => (doc/'end-on').text, :stick => (doc/'stick').text \n render :text => \"ok\"\n end", "def post; end", "def create\n @post = Post.new(params[:post])\n\n @post.update_attribute(:user_id, current_user.id)\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n make_rss\n end", "def post endpoint, data\n do_request :post, endpoint, data\n end", "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(posts_url, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(*args)\n execute(:post, *args)\n end", "def posts(opts)\n response = get(\"posts\", opts)\n response\n end", "def create(name=\"Default Name\", age=\"50\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <name>#{name}</name>\r\n <age>#{age}</age>\r\n </person>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n response.body \r\n end", "def create_posts\n end", "def create_posts\n end", "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post251 = Post251.new(params[:post251])\n\n respond_to do |format|\n if @post251.save\n format.html { redirect_to(@post251, :notice => 'Post251 was successfully created.') }\n format.xml { render :xml => @post251, :status => :created, :location => @post251 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post251.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(path, options={})\n request :post, path, options\n end", "def create\r\n @post = Post.new(params[:post])\r\n\r\n respond_to do |format|\r\n if @post.save\r\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\r\n format.xml { render :xml => @post, :status => :created, :location => @post }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\r\n @post = Post.new(params[:post])\r\n\r\n respond_to do |format|\r\n if @post.save\r\n format.html { redirect_to(@post, :notice => 'Post was successfully created.') }\r\n format.xml { render :xml => @post, :status => :created, :location => @post }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def post(uri, doc = nil, options = {})\n execute(uri, :post, options, doc)\n end", "def create_post\n begin\n #asks the user for the title, body, and whether it should be anonymous\n print \"Title: \"\n title = STDIN.gets.chomp\n print \"Body: \"\n body = STDIN.gets.chomp\n print \"Post as Anonymous? (y/n): \"\n anonymous = STDIN.gets.chomp.upcase == 'Y' ? true : false\n # check user information from login\n\n # Rails will reject this unless you configure the cross_forgery_request check to\n # a null_session in the receiving controller. This is because we are not sending\n # an authenticity token. Rails by default will only send the token with forms /users/new and\n # /users/1/edit and REST clients don't get those.\n # We could perhaps arrange to send this on a previous\n # request but we would then have to have an initial call (a kind of login perhaps).\n # This will automatically send as a multi-part request because we are adding a\n # File object.\n response = RestClient.post \"#{@@DOMAIN}/api/posts.json\",\n\n {\n post: {\n title: title,\n body: body,\n anonymous: anonymous\n },\n }, authorization_hash\n\n if (response.code == 201)\n puts \"Created successfully\"\n end\n puts \"URL for new resource: #{response.headers[:location]}\"\n rescue => e\n puts STDERR, \"Error accessing REST service. Error: #{e}\"\n end\n end", "def posts; end", "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "def post\n Rentlinx.client.post(self)\n end", "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to post_url(@post) }\n# format.xml { head :created, :location => post_url(@post) }\n else\n format.html { render :action => \"new\" }\n# format.xml { render :xml => @post.errors.to_xml }\n end\n end\n end", "def create\n post\n end", "def test_create_on_post\n post :create,\n :post_id => posts(:by_quentin).id,\n :content => 'This is a test note from aaron...'\n assert_response :redirect\n end", "def create\n @post = Post.new(params[:post])\n @post.published = true\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Запись успешно создана.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def posts\n posts = @client.entries(content_type: 'post').items\n posts || []\n end", "def save\n self.client.api_post(\"/feed\", self.create_params)\n end", "def posts\n @url = MYHOST + \"/api/posts/all\"\n\n\n @respuesta = HTTParty.get(\n @url.to_str\n )\n\n @body = @respuesta.body\n if @body \n redirect_to api_resultado_path(:body => @body, :token => @token)\n return\n end\n end", "def create\n @post246 = Post246.new(params[:post246])\n\n respond_to do |format|\n if @post246.save\n format.html { redirect_to(@post246, :notice => 'Post246 was successfully created.') }\n format.xml { render :xml => @post246, :status => :created, :location => @post246 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post246.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\r\n @post = current_user.posts.new(params[:post])\r\n respond_to do |format|\r\n if @post.save\r\n flash[:notice] = 'Post was successfully created.'\r\n format.html { redirect_to(@post) }\r\n format.xml { render :xml => @post, :status => :created, :location => @post }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @post78 = Post78.new(params[:post78])\n\n respond_to do |format|\n if @post78.save\n format.html { redirect_to(@post78, :notice => 'Post78 was successfully created.') }\n format.xml { render :xml => @post78, :status => :created, :location => @post78 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post78.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(data = \"\")\n submit :Post, data\n end", "def post(data = {})\n call data, method: :post\n end", "def post(path, data={})\n request(:post, path, data)\n end", "def post(uri, params = {})\n send_request(uri, :post, params)\n end", "def post(path, params={})\n request(:post, path, params)\n end", "def post(path, params={})\n request(:post, path, params)\n end", "def post(path, params={})\n request(:post, path, params)\n end", "def post(path, params = {})\n\t\trequest(path, :post, params)\n\tend", "def post(path, options={})\n send_request 'post', path, options\n end", "def create\n @post157 = Post157.new(params[:post157])\n\n respond_to do |format|\n if @post157.save\n format.html { redirect_to(@post157, :notice => 'Post157 was successfully created.') }\n format.xml { render :xml => @post157, :status => :created, :location => @post157 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post157.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post_headers\n {\"Content-Type\" => 'text/xml; charset=utf-8'}\n end", "def create\n post_service = PostService.new(current_user, params)\n post_service.create_post\n #post_service.create\n respond_to do |format|\n if post_service.save?\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { redirect_to new_post_url, alert: post_service.errors }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def send_post(data_xml,url)\r\n result = @client.post(self.target_uri(url), :body => data_xml , :head => {'Content-Type' => 'application/xml'} ) \r\n raise \"Invalid status #{result.http_status} from server #{@host}:#{@port}\" if(result.http_status != '200') \r\n #reply = Reply.from_xml(result.http_body)\r\n if block_given?\r\n yield(result.http_body)\r\n else\r\n result.http_body\r\n end\r\n end", "def post(path, options = {})\n request(:post, path, options)\n end", "def post(path, options = {})\n request(:post, path, options)\n end", "def post(path, options = {})\n request(:post, path, options)\n end", "def post!\n request! :post\n end", "def create\n respond_with Post.create(post_params)\n end", "def api_post(action, data)\n api_request(action, data, 'POST')\n end", "def create\n @post405 = Post405.new(params[:post405])\n\n respond_to do |format|\n if @post405.save\n format.html { redirect_to(@post405, :notice => 'Post405 was successfully created.') }\n format.xml { render :xml => @post405, :status => :created, :location => @post405 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post405.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(path, options = {})\n request(:post, path, options)\n end", "def post(path, options = {})\n request(:post, path, options)\n end", "def post(path, options = {})\n request(:post, path, options)\n end", "def create\n @post57 = Post57.new(params[:post57])\n\n respond_to do |format|\n if @post57.save\n format.html { redirect_to(@post57, :notice => 'Post57 was successfully created.') }\n format.xml { render :xml => @post57, :status => :created, :location => @post57 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post57.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post445 = Post445.new(params[:post445])\n\n respond_to do |format|\n if @post445.save\n format.html { redirect_to(@post445, :notice => 'Post445 was successfully created.') }\n format.xml { render :xml => @post445, :status => :created, :location => @post445 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post445.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post }\n end\n make_rss\n end", "def post(method, params = {})\n url = make_url method, params\n query = url.query\n url.query = nil\n\n req = Net::HTTP::Post.new url.path\n req.body = query\n req.content_type = 'application/x-www-form-urlencoded'\n\n res = Net::HTTP.start url.host, url.port do |http|\n http.request req\n end\n\n xml = Nokogiri::XML(res.body, nil, nil, 0)\n\n check_error xml\n\n parse_response xml\n rescue SystemCallError, SocketError, Timeout::Error, IOError,\n Nokogiri::XML::SyntaxError => e\n raise CommunicationError.new(e)\n rescue Net::HTTPError => e\n xml = Nokogiri::XML(e.res.body) { |cfg| cfg.strict }\n check_error xml\n raise CommunicationError.new(e)\n end", "def render_post\n respond_to do |wants| \n wants.html {render :to_xml => 'POST.xml.builder', :layout => false, :status => 201}\n wants.json {render :to_json => 'POST.xml.builder', :status => 201}\n wants.xml {render :to_xml => 'POST.xml.builder', :layout => false, :status => 201}\n wants.yaml {render :to_yaml => 'POST.xml.builder', :status => 201}\n end \n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def create\n res = self.class.post('/', body: attrs)\n res.created?\n end", "def create\n @post = postable.posts.build(params[:post])\n @post.author = current_agent\n\n respond_to do |format|\n if @post.save\n flash[:success] = t('post.created')\n format.html { redirect_to(polymorphic_path([ postable.container, postable ], :anchor => dom_id(@post))) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(name=\"Default name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Post.new(@url)\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n response.body\n end", "def post(path, params = {})\n request(:post, path, params)\n end", "def create\n @post125 = Post125.new(params[:post125])\n\n respond_to do |format|\n if @post125.save\n format.html { redirect_to(@post125, :notice => 'Post125 was successfully created.') }\n format.xml { render :xml => @post125, :status => :created, :location => @post125 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post125.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post = current_user.posts.build(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(@post, :notice => 'Post created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @posts = Post.find_all_by_kiez(get_kiez, :order => 'updated_at DESC')\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n flash[:notice] = 'Die Anzeige wurde erfolgreich erstellt.'\n puts @post.inspect\n ContactMailer.deliver_notify(@post)\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(content)\n post_to(\"/api/v1/messages/\", {:body => content})\n end", "def post(path, params={})\n signature_params = params.values.any?{|value| value.respond_to?(:to_io)} ? {} : params\n request(:post, path, params.to_xml, signature_params)\n end", "def create\n \n @onpost = Onpost.new(params[:onpost])\n respond_to do |format|\n if @onpost.save\n flash[:notice] = 'Onpost was successfully created.'\n format.html { redirect_to :back }\n format.xml { render :xml => @onpost, :status => :created, :location => @onpost }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @onpost.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post168 = Post168.new(params[:post168])\n\n respond_to do |format|\n if @post168.save\n format.html { redirect_to(@post168, :notice => 'Post168 was successfully created.') }\n format.xml { render :xml => @post168, :status => :created, :location => @post168 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post168.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create \n\t\tif params[:message] != ''\n\t\t\t@post = Post.create(:message => params[:message]) \n\t\t\t@post.user = current_user\n\t\t\trespond_to do |format| \n\t\t\t\tif @post.save \n\t\t\t\t\tflash[:notice] = 'Post was successfully created.'\n\t\t\t\t\tformat.html { redirect_to :back } \n\t\t\t\t\tformat.xml { render:xml => @post}\n\t\t\t\telse \n\t\t\t\t\tflash[:notice] = \"Message failed to save.\" \n\t\t\t\t\tformat.html { redirect_to :back }\n\t\t\t\t\tformat.xml { render :xml => @post.errors, \n\t\t\t\t\t\t\t\t\t:status => :unprocessable_entity } \n\t\t\t\tend \n\t\t\tend\n\t\telse\n\t\t\tredirect_to(posts_url)\n\t\tend\n \tend", "def create\n @post245 = Post245.new(params[:post245])\n\n respond_to do |format|\n if @post245.save\n format.html { redirect_to(@post245, :notice => 'Post245 was successfully created.') }\n format.xml { render :xml => @post245, :status => :created, :location => @post245 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post245.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @post = Post.new(params[:post])\n @post.user = find_current_user\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to(posts_url, :notice => 'Post was successfully created.') }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post(attrs = nil)\n attrs ||= attributes\n\n execute_request('POST') do |uri, headers|\n HTTP.http_client.post(\n uri,\n body: adapter.serialize(attrs),\n header: headers.merge(CONTENT_TYPE_HEADERS)\n )\n end\n end", "def post(body)\n request = Net::HTTP::Post.new(bind_uri)\n request.body = body\n request.content_length = request.body.size\n request[\"Content-Type\"] = \"text/xml; charset=utf-8\"\n\n Jabber.debug(\"Sending POST request - #{body.strip}\")\n\n response = Net::HTTP.new(domain, port).start { |http| http.request(request) }\n\n Jabber.debug(\"Receiving POST response - #{response.code}: #{response.body.inspect}\")\n\n unless response.is_a?(Net::HTTPSuccess)\n raise Net::HTTPBadResponse, \"Net::HTTPSuccess expected, but #{response.class} was received\"\n end\n\n response\n end" ]
[ "0.6847672", "0.6799606", "0.6638679", "0.6625985", "0.6582057", "0.63850963", "0.6320757", "0.627628", "0.62496513", "0.62292284", "0.6224684", "0.6214792", "0.62033695", "0.61848694", "0.6183795", "0.61547226", "0.61526495", "0.6142421", "0.61416507", "0.6132199", "0.61245", "0.6108245", "0.6101822", "0.60697603", "0.60569924", "0.6050653", "0.6049604", "0.604048", "0.604048", "0.59886146", "0.5959978", "0.59468424", "0.59468424", "0.5922079", "0.59137267", "0.59137267", "0.5911393", "0.58793616", "0.5839455", "0.5839107", "0.5831156", "0.58305514", "0.5817215", "0.5810097", "0.5803666", "0.5797193", "0.5789366", "0.578872", "0.5788074", "0.5779689", "0.57708967", "0.5759388", "0.5753247", "0.57518476", "0.57462513", "0.5741735", "0.5741735", "0.5741735", "0.5734553", "0.5733125", "0.57234645", "0.5719181", "0.5718392", "0.5717206", "0.5706701", "0.5706701", "0.5706701", "0.57052946", "0.57021093", "0.57017684", "0.5700551", "0.56868243", "0.56868243", "0.56868243", "0.56861264", "0.568474", "0.5680362", "0.5680195", "0.5675266", "0.56708044", "0.56708044", "0.56708044", "0.56708044", "0.56708044", "0.5662974", "0.5662669", "0.56615037", "0.5657771", "0.5657349", "0.5657287", "0.5653152", "0.5652005", "0.56413996", "0.56398284", "0.5637301", "0.5635525", "0.56298244", "0.5629634", "0.5627891", "0.5627172" ]
0.60040534
29
PUT /posts/1 PUT /posts/1.xml
def update @post = Post.find(params[:id]) respond_to do |format| if @post.update_attributes(params[:post]) format.html { redirect_to("/#{@post.url}", :notice => t('controller.updated')) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @post.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n make_rss\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(post_params)\n format.json { head :no_content }\n format.xml { head :no_content }\n else\n format.json { render json: @post.errors, status: :unprocessable_entity }\n format.xml { render xml: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_with Post.update(params[:id], params[:posts])\n end", "def put(*args)\n request :put, *args\n end", "def update(id, name=\"Updated Name\", age=\"55\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <person>\r\n <id type='integer'>#{id}</id>\r\n <name>#{name}</name>\r\n <age>#{age}</age> \r\n </person>\"\r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "def update(id, name= \"Updated Name\")\n xml_req =\n \"<?xml version='1.0' encoding='UTF-8'?>\n <customer>\n <id type='integer'>#{id}</id>\n <name>#{name}</name>\n </customer>\"\n\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\n request.add_field \"Content-Type\", \"application/xml\"\n request.body = xml_req\n\n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n\n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end", "def update\n @post = Post.find(params[:id])\n\t@posts = Post.all\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_with post.update(params[:id], params[:post])\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(uri, doc = nil, options = {})\n execute(uri, :put, options, doc)\n end", "def put(*args)\n request(:put, *args)\n end", "def update\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n respond_to do |format|\n if post.update_attributes(params[:post])\n flash[:success] = t('post.updated')\n format.html { redirect_to(polymorphic_path([ postable.container, postable ], :anchor => dom_id(@post))) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(posts_url, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n @post = Post.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @post.update_attributes(params[:post])\r\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_with Post.update(params[:id],post_params)\n end", "def update\n @post = Post.find(params[:id])\n \n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => t('posts.show.post_updated')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to post_url(@post) }\n# format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n# format.xml { render :xml => @post.errors.to_xml }\n end\n end\n end", "def update\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id])\n @post.PostID = params[:id].to_i\n @post.title = params[:title]\n\n respond_to do |format|\n if r.save(@post)\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(@post) }\n format.xml { render :xml => @post, :status => :created, :location => @post }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(*args)\n prepare_request(:put, args)\n @@client.add(:put, @path, *args)\n end", "def test_update_post\n data = {\n title: \"Roll lemon\",\n content: \"Gingerbread bear claw muffin danish danish marzipan. Toffee lollipop wafer carrot cake dessert.\",\n description: \"Chocolate tootsie roll lemon drops. Chupa chups chocolate bar apple pie\",\n image: \"chocolate.png\",\n status: 1\n }\n expected = 200\n post_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+post_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Put.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end", "def update(*args)\n put(*args)\n end", "def update(*args)\n put(*args)\n end", "def update\n update! { posts_url }\n end", "def update\n @post251 = Post251.find(params[:id])\n\n respond_to do |format|\n if @post251.update_attributes(params[:post251])\n format.html { redirect_to(@post251, :notice => 'Post251 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post251.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n @title = @post.title\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :flash => { :success => 'Post was successfully updated.' } ) }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n format.json { render :json => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(path, doc = nil, options = {})\n execute('PUT', path, options, doc)\n end", "def update\n respond_to do |format|\n @post.title = params[:title]\n @post.body = params[:body]\n @tags = params[:tags].split(',') unless params[:tags].blank?\n Post.transaction do\n if @post.save\n destroy_tags(@post, @tags)\n create_tags(@post, @tags)\n format.html { redirect_to posts_path, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n @action_path = post_path @post\n @method = :put\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def put_datastream(pid, dsID, xml)\n uri = URI.parse(@fedora + '/objects/' + pid + '/datastreams/' + dsID ) \n RestClient.put(uri.to_s, xml, :content_type => \"application/xml\")\n rescue => e\n e.response \n end", "def update\n @post182 = Post182.find(params[:id])\n\n respond_to do |format|\n if @post182.update_attributes(params[:post182])\n format.html { redirect_to(@post182, :notice => 'Post182 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post182.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n update_resource_response(@post, blog_post_params)\n end", "def update\n redirect_to '/posts'\n end", "def update\n @post157 = Post157.find(params[:id])\n\n respond_to do |format|\n if @post157.update_attributes(params[:post157])\n format.html { redirect_to(@post157, :notice => 'Post157 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post157.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post]) then\n Feed.update_post(@post)\n format.js { render :action => \"update.rjs\" } if request.xhr?\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n title = params[:title]\n body = params[:body]\n\n @post.update!(title: title, body: body)\n\n if @post.save!\n json_response(@post)\n else\n json_response(@post.errors)\n end\n end", "def update\n put :update\n end", "def update\n @post231 = Post231.find(params[:id])\n\n respond_to do |format|\n if @post231.update_attributes(params[:post231])\n format.html { redirect_to(@post231, :notice => 'Post231 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post231.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put payload, path = \"\"\n make_request(path, \"put\", payload)\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def post\n doc = Nokogiri::XML(request.body)\n id= (doc/'id').text\n # p = Post.exists?(id) ? Post.find(id) : Post.new\n p= Post.find_or_create_by_intranet_id id\n p.update_attributes :subject => (doc/'subject').text,\n :body => (doc/'body').text, :post_type => (doc/'post-type').text,\n :pic => (doc/'pic') .text, :begin_on=>(doc/'begin-on').text,\n :pic_postimg => (doc/'pic-postimg').text,\n :video => (doc/'video').text, \n :end_on => (doc/'end-on').text, :stick => (doc/'stick').text \n render :text => \"ok\"\n end", "def update\r\n @post = Post.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @post.update_attributes(params[:post])\r\n format.html { redirect_to(:action => 'adminlist') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @post275 = Post275.find(params[:id])\n\n respond_to do |format|\n if @post275.update_attributes(params[:post275])\n format.html { redirect_to(@post275, :notice => 'Post275 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post275.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post.author ||= current_user\n @post.current_revision.user = current_user\n check_for_draft\n respond_to do |format|\n if @post.update_attributes(params[:post])\n handle_pingbacks\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post253 = Post253.find(params[:id])\n\n respond_to do |format|\n if @post253.update_attributes(params[:post253])\n format.html { redirect_to(@post253, :notice => 'Post253 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post253.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "def put(path, options={})\n request :put, path, options\n end", "def update\n @post78 = Post78.find(params[:id])\n\n respond_to do |format|\n if @post78.update_attributes(params[:post78])\n format.html { redirect_to(@post78, :notice => 'Post78 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post78.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post81 = Post81.find(params[:id])\n\n respond_to do |format|\n if @post81.update_attributes(params[:post81])\n format.html { redirect_to(@post81, :notice => 'Post81 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post81.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post246 = Post246.find(params[:id])\n\n respond_to do |format|\n if @post246.update_attributes(params[:post246])\n format.html { redirect_to(@post246, :notice => 'Post246 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post246.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post245 = Post245.find(params[:id])\n\n respond_to do |format|\n if @post245.update_attributes(params[:post245])\n format.html { redirect_to(@post245, :notice => 'Post245 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post245.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n @post = Post.find(params[:id])\r\n @root_post = root_post_of(@post)\r\n\r\n respond_to do |format|\r\n if @post.update_attributes(params[:post])\r\n @root_post.touch(:updated_at)\r\n update_child_posts(@post)\r\n\r\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @post.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @post.update_attributes(params[:post])\n respond_with(@post)\n end", "def update\n @post321 = Post321.find(params[:id])\n\n respond_to do |format|\n if @post321.update_attributes(params[:post321])\n format.html { redirect_to(@post321, :notice => 'Post321 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post321.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post328 = Post328.find(params[:id])\n\n respond_to do |format|\n if @post328.update_attributes(params[:post328])\n format.html { redirect_to(@post328, :notice => 'Post328 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post328.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post181 = Post181.find(params[:id])\n\n respond_to do |format|\n if @post181.update_attributes(params[:post181])\n format.html { redirect_to(@post181, :notice => 'Post181 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post181.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n post = current_user.posts.find_by_uuid(params[:id])\n return render_item_not_found('Post') unless post\n post.update_attributes(post_params)\n broadcast(post, 'update')\n head :ok\n end", "def update\n @request.accept\n redirect_to posts_url\n end", "def put(path = '/files/', params = {})\n request :put, path, params\n end", "def update\n id = Post.find(params[:id])._id\n \n respond_to do |format|\n if ((@post.update_attributes(params[:post])) && (@post._id = id))\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @post273 = Post273.find(params[:id])\n\n respond_to do |format|\n if @post273.update_attributes(params[:post273])\n format.html { redirect_to(@post273, :notice => 'Post273 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post273.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = Post.find(params[:id])\n @post.tag_list = params[:tags]\n respond_to do |format|\n if @post.update_attributes(params[:post])\n format.html { redirect_to(@post, :notice => 'Post was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end", "def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n 'Accept': 'application/json'),\n :put, nil, body.to_json)\n end", "def update\n @post = Post.find(params[:id])\n\n respond_to do |format|\n @post.update_attributes(params[:post])\n format.html { redirect_to posts_url, notice: 'Post was successfully updated.' }\n format.json { head :no_content }\n end \n end", "def update\n @post193 = Post193.find(params[:id])\n\n respond_to do |format|\n if @post193.update_attributes(params[:post193])\n format.html { redirect_to(@post193, :notice => 'Post193 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post193.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post107 = Post107.find(params[:id])\n\n respond_to do |format|\n if @post107.update_attributes(params[:post107])\n format.html { redirect_to(@post107, :notice => 'Post107 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post107.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @onpost = Onpost.find(params[:id])\n\n respond_to do |format|\n if @onpost.update_attributes(params[:onpost])\n flash[:notice] = 'Onpost was successfully updated.'\n format.html { redirect_to(@onpost) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @onpost.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post483 = Post483.find(params[:id])\n\n respond_to do |format|\n if @post483.update_attributes(params[:post483])\n format.html { redirect_to(@post483, :notice => 'Post483 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post483.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def put(path, params = {})\n request(:put, path, params)\n end", "def update\n @post120 = Post120.find(params[:id])\n\n respond_to do |format|\n if @post120.update_attributes(params[:post120])\n format.html { redirect_to(@post120, :notice => 'Post120 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post120.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post134 = Post134.find(params[:id])\n\n respond_to do |format|\n if @post134.update_attributes(params[:post134])\n format.html { redirect_to(@post134, :notice => 'Post134 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post134.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post66 = Post66.find(params[:id])\n\n respond_to do |format|\n if @post66.update_attributes(params[:post66])\n format.html { redirect_to(@post66, :notice => 'Post66 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post66.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post = @contest.posts.find(params[:id])\n\n respond_to do |format|\n if @post.update_attributes(params[:post])\n flash[:notice] = 'Post was successfully updated.'\n format.html { redirect_to(@post) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post101 = Post101.find(params[:id])\n\n respond_to do |format|\n if @post101.update_attributes(params[:post101])\n format.html { redirect_to(@post101, :notice => 'Post101 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post101.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post143 = Post143.find(params[:id])\n\n respond_to do |format|\n if @post143.update_attributes(params[:post143])\n format.html { redirect_to(@post143, :notice => 'Post143 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post143.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(doc, uri=nil, content_type=nil)\n return _put_doc(doc, uri, content_type)\n end", "def update\n @post284 = Post284.find(params[:id])\n\n respond_to do |format|\n if @post284.update_attributes(params[:post284])\n format.html { redirect_to(@post284, :notice => 'Post284 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post284.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @post125 = Post125.find(params[:id])\n\n respond_to do |format|\n if @post125.update_attributes(params[:post125])\n format.html { redirect_to(@post125, :notice => 'Post125 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post125.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n@post = Post.find(params[:id])\nrespond_to do |format|\nif @post.update_attributes(params[:post])\nflash[:notice] = 'Post was successfully updated.'\nformat.html { redirect_to posts_path(\n:forum_id => params[:forum_id],\n:topic_id => params[:topic_id]) }\nformat.xml { head :ok }\nelse\nformat.html { render :action => \"edit\" }\nformat.xml { render :xml => @post.errors.to_xml }\nend\nend\nend", "def update\n @post = Post.find(params[:id])\n\tpublished = false\n\tif params[:post][:published] == 1\n\t published = true\n\tend\n\n respond_to do |format|\n if @post.update_attributes(params[:post] )\n format.html { redirect_to(@post, :notice => 'Post updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put endpoint, data\n do_request :put, endpoint, data\n end", "def update\n @post156 = Post156.find(params[:id])\n\n respond_to do |format|\n if @post156.update_attributes(params[:post156])\n format.html { redirect_to(@post156, :notice => 'Post156 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post156.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(path, params={})\n request(:put, path, params)\n end", "def put(path, params={})\n request(:put, path, params)\n end", "def put(path, params={})\n request(:put, path, params)\n end", "def put(path, params={})\n request(:put, path, params)\n end", "def put(path, params={})\n request(:put, path, params)\n end", "def put(path, params={})\n request(:put, path, params)\n end" ]
[ "0.6867673", "0.66907144", "0.6294395", "0.62794256", "0.6099675", "0.6098852", "0.6035446", "0.590173", "0.58895403", "0.5880021", "0.58741546", "0.5867954", "0.5849058", "0.5837317", "0.5833679", "0.58261484", "0.5825736", "0.5818691", "0.58159804", "0.58100533", "0.58100533", "0.58100533", "0.58100533", "0.58056474", "0.58053356", "0.5782647", "0.5746143", "0.57334566", "0.57311493", "0.57014084", "0.56923133", "0.56901574", "0.56901574", "0.5686076", "0.56612194", "0.56555593", "0.5654249", "0.5653651", "0.5651996", "0.5651102", "0.5643569", "0.56417733", "0.5635933", "0.5610392", "0.5608158", "0.5603139", "0.5600439", "0.5599689", "0.55984175", "0.55961937", "0.5575449", "0.557458", "0.55743843", "0.5568167", "0.5568106", "0.5567454", "0.55669326", "0.5555517", "0.55506414", "0.5550475", "0.55434495", "0.5539862", "0.5538768", "0.55309653", "0.5527094", "0.55199236", "0.5517754", "0.551749", "0.5514836", "0.5507115", "0.5503528", "0.5486096", "0.548296", "0.5476181", "0.54727274", "0.54707205", "0.5467842", "0.54669976", "0.5462694", "0.5462694", "0.5462694", "0.5462614", "0.5461398", "0.5459898", "0.54595584", "0.5453652", "0.54493564", "0.5446812", "0.54454684", "0.5444855", "0.5444017", "0.5439702", "0.5423656", "0.5415436", "0.54132944", "0.54132944", "0.54132944", "0.54132944", "0.54132944", "0.54132944" ]
0.59057415
7
DELETE /posts/1 DELETE /posts/1.xml
def destroy @post = Post.find(params[:id]) @post.destroy respond_to do |format| format.html { redirect_to(root_path, :notice => t('controller.deleted')) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n r = PostRepository.new\n @post = r.GetPost(\"PostID\", params[:id].to_i)\n r.delete @post\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.deleted = 1\n @post.save\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n make_rss\n end", "def destroy\n\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(posts_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(posts_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "def delete_post\n\t \n \tend", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n \n respond_to do |format|\n format.html { redirect_to(posts_url, notice: t('posts.index.post_deleted')) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(root_url, :notice => 'Post was successfully removed.') }\n format.xml { head :ok }\n end\n end", "def destroy\n if @post.destroy\n flash[:notice] = \"post deleted!\"\n end\n respond_to do |format|\n format.html { redirect_to(posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to posts_url }\n# format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "def destroy\n @post251 = Post251.find(params[:id])\n @post251.destroy\n\n respond_to do |format|\n format.html { redirect_to(post251s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n respond_to do |format|\n format.html { redirect_to(admin_posts_url, :notice => 'Successfully deleted') }\n format.xml { head :ok }\n end\n end", "def destroy\n @post445 = Post445.find(params[:id])\n @post445.destroy\n\n respond_to do |format|\n format.html { redirect_to(post445s_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @post246 = Post246.find(params[:id])\n @post246.destroy\n\n respond_to do |format|\n format.html { redirect_to(post246s_url) }\n format.xml { head :ok }\n end\n end", "def delete\n @post = Post.find(params[:id])\n end", "def delete(url)\n raise Error, \"Missing URL\" unless url\n get('posts/delete?uri=' << u(url))\n nil\n end", "def destroy\n @post446 = Post446.find(params[:id])\n @post446.destroy\n\n respond_to do |format|\n format.html { redirect_to(post446s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n\n head :no_content\n end", "def destroy\n destroy_q(@post, posts_url)\n end", "def destroy\n @post405 = Post405.find(params[:id])\n @post405.destroy\n\n respond_to do |format|\n format.html { redirect_to(post405s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post134 = Post134.find(params[:id])\n @post134.destroy\n\n respond_to do |format|\n format.html { redirect_to(post134s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post321 = Post321.find(params[:id])\n @post321.destroy\n\n respond_to do |format|\n format.html { redirect_to(post321s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post66 = Post66.find(params[:id])\n @post66.destroy\n\n respond_to do |format|\n format.html { redirect_to(post66s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n #@post = @contest.posts.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_path) }\n format.xml { head :ok }\n end\n end", "def destroy\r\n @post = Post.find(params[:id])\r\n @post.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(:action => 'adminlist') }\r\n format.xml { head :ok }\r\n end\r\n end", "def destroy\n @post.destroy\n head :no_content\n end", "def destroy\n @post.destroy\n head :no_content\n end", "def destroy\n @post407 = Post407.find(params[:id])\n @post407.destroy\n\n respond_to do |format|\n format.html { redirect_to(post407s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post57 = Post57.find(params[:id])\n @post57.destroy\n\n respond_to do |format|\n format.html { redirect_to(post57s_url) }\n format.xml { head :ok }\n end\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n@post = Post.find(params[:id])\n@post.destroy\nrespond_to do |format|\nformat.html { redirect_to posts_path(:forum_id => params[:forum_id],\n:topic_id => params[:topic_id]) }\nformat.xml { head :ok }\nend\nend", "def destroy\n @post55 = Post55.find(params[:id])\n @post55.destroy\n\n respond_to do |format|\n format.html { redirect_to(post55s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t@post = Post.find(params[:id])\n @post.destroy\n flash[:success] = \"Post deleted\"\n respond_to do |format|\n format.html { redirect_to(user_posts_path(@post.user)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @offpost = Offpost.find(params[:id])\n @offpost.destroy\n\n respond_to do |format|\n format.html { redirect_to(offposts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post78 = Post78.find(params[:id])\n @post78.destroy\n\n respond_to do |format|\n format.html { redirect_to(post78s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post447 = Post447.find(params[:id])\n @post447.destroy\n\n respond_to do |format|\n format.html { redirect_to(post447s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post54 = Post54.find(params[:id])\n @post54.destroy\n\n respond_to do |format|\n format.html { redirect_to(post54s_url) }\n format.xml { head :ok }\n end\n end", "def delete(id, post)\n File.unlink(post_path(post))\n\n update_digests do |digests|\n digests.delete(id)\n end\n end", "def destroy\n @post157 = Post157.find(params[:id])\n @post157.destroy\n\n respond_to do |format|\n format.html { redirect_to(post157s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = Post.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n save_notice(\"文章删除成功.\")\n format.html { redirect_to(cpanel_posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post328 = Post328.find(params[:id])\n @post328.destroy\n\n respond_to do |format|\n format.html { redirect_to(post328s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n head :no_content\n end", "def destroy\n @post.destroy\n back_to = params[:back_to] || posts_url\n respond_to do |format|\n format.html { redirect_to(back_to) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post182 = Post182.find(params[:id])\n @post182.destroy\n\n respond_to do |format|\n format.html { redirect_to(post182s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = @topic.posts.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(forum_topic_url(@forum, @topic)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post245 = Post245.find(params[:id])\n @post245.destroy\n\n respond_to do |format|\n format.html { redirect_to(post245s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post = @topic.posts.find(params[:id])\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_topic_url(@project, @topic)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post483 = Post483.find(params[:id])\n @post483.destroy\n\n respond_to do |format|\n format.html { redirect_to(post483s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post75 = Post75.find(params[:id])\n @post75.destroy\n\n respond_to do |format|\n format.html { redirect_to(post75s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n Post.find(params[:id]).delete\n\n redirect_to '/'\n end", "def destroy\n @post149 = Post149.find(params[:id])\n @post149.destroy\n\n respond_to do |format|\n format.html { redirect_to(post149s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post154 = Post154.find(params[:id])\n @post154.destroy\n\n respond_to do |format|\n format.html { redirect_to(post154s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post125 = Post125.find(params[:id])\n @post125.destroy\n\n respond_to do |format|\n format.html { redirect_to(post125s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n post.destroy\n\n respond_to do |format|\n format.html { redirect_to(polymorphic_path([@postable.container, @postable], :anchor => 'posts')) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post453 = Post453.find(params[:id])\n @post453.destroy\n\n respond_to do |format|\n format.html { redirect_to(post453s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post10 = Post10.find(params[:id])\n @post10.destroy\n\n respond_to do |format|\n format.html { redirect_to(post10s_url) }\n format.xml { head :ok }\n end\n end", "def delete_post\n post = Post.find_by_id(params[:id])\n if !post.nil?\n post.destroy\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @post184 = Post184.find(params[:id])\n @post184.destroy\n\n respond_to do |format|\n format.html { redirect_to(post184s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post74 = Post74.find(params[:id])\n @post74.destroy\n\n respond_to do |format|\n format.html { redirect_to(post74s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post464 = Post464.find(params[:id])\n @post464.destroy\n\n respond_to do |format|\n format.html { redirect_to(post464s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post.destroy\n end", "def destroy\n @post150 = Post150.find(params[:id])\n @post150.destroy\n\n respond_to do |format|\n format.html { redirect_to(post150s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n\n end", "def destroy\n @post129 = Post129.find(params[:id])\n @post129.destroy\n\n respond_to do |format|\n format.html { redirect_to(post129s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post21 = Post21.find(params[:id])\n @post21.destroy\n\n respond_to do |format|\n format.html { redirect_to(post21s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post409 = Post409.find(params[:id])\n @post409.destroy\n\n respond_to do |format|\n format.html { redirect_to(post409s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post99 = Post99.find(params[:id])\n @post99.destroy\n\n respond_to do |format|\n format.html { redirect_to(post99s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to(posts_url, :notice => \"Post (#{@post.title}) was successfully deleted.\") }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def destroy\n @blog_post = BlogPost.find(params[:id])\n @blog_post.destroy\n\n respond_to do |format|\n format.html { redirect_to(blog_posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @blog_post = BlogPost.find(params[:id])\n @blog_post.destroy\n\n respond_to do |format|\n format.html { redirect_to(blog_posts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post_note = PostNote.find(params[:id])\n @post_note.destroy\n\n respond_to do |format|\n format.html { redirect_to(post_notes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post101 = Post101.find(params[:id])\n @post101.destroy\n\n respond_to do |format|\n format.html { redirect_to(post101s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post.destroy\n\n respond_to do |format|\n format.html { redirect_to blog_posts_path, notice: 'Post was successfully destroyed.' }\n format.xml {head :ok }\n format.json { head :no_content }\n end\n end", "def destroy\n @post81 = Post81.find(params[:id])\n @post81.destroy\n\n respond_to do |format|\n format.html { redirect_to(post81s_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @post181 = Post181.find(params[:id])\n @post181.destroy\n\n respond_to do |format|\n format.html { redirect_to(post181s_url) }\n format.xml { head :ok }\n end\n end" ]
[ "0.7365624", "0.7322596", "0.72059286", "0.715179", "0.715179", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.7068259", "0.70451736", "0.7041529", "0.7040201", "0.7003356", "0.6966629", "0.69642085", "0.691911", "0.6913336", "0.6886652", "0.683633", "0.68302375", "0.68173075", "0.68145967", "0.68008894", "0.68001777", "0.67938507", "0.6780227", "0.6773315", "0.67686003", "0.67588013", "0.6755028", "0.67485183", "0.67350566", "0.67339945", "0.6731557", "0.67295295", "0.67281026", "0.67281026", "0.6726317", "0.6715316", "0.6706418", "0.67061573", "0.67017454", "0.66882473", "0.6683431", "0.6681235", "0.66810334", "0.66785", "0.6675209", "0.6674261", "0.66676027", "0.66579735", "0.66576815", "0.665357", "0.664931", "0.6647831", "0.66473997", "0.664443", "0.66437715", "0.66428995", "0.66392773", "0.6638891", "0.6633285", "0.6628", "0.66277605", "0.6627475", "0.6624094", "0.66194755", "0.6619459", "0.6615494", "0.66104335", "0.6608262", "0.66078746", "0.66078746", "0.66078746", "0.66078746", "0.6605365", "0.66036683", "0.6598655", "0.65969294", "0.65967304", "0.6595475", "0.6594835", "0.6592946", "0.6592946", "0.6583013", "0.6582412", "0.65808076", "0.6579295", "0.65787655" ]
0.70919865
5
Processes the given email, submits attachments to the Heathen server, delivers responses as configured
def process email, mail_to, is_rts=false documents = [] unless email.has_attachments? logger.info "From: #{email.from} Subject: (#{email.subject}) Files: no attachments" return end logger.info "From: #{email.from} Subject: (#{email.subject}) Files: #{email.attachments.map(&:filename).join(',')}" # # Convert the attachments # email.attachments.each do |attachment| begin converter = AutoHeathen::Converter.new( { logger: logger } ) input_source = attachment.body.decoded action = converter.get_action input_source.content_type logger.info " convert #{attachment.filename} using action: #{action}" converted_filename, data = converter.convert action, @cfg[:language], attachment.filename, input_source documents << { orig_filename: attachment.filename, orig_content: input_source, filename: converted_filename, content: data, error: false } rescue StandardError => e documents << { orig_filename: attachment.filename, orig_content: input_source, filename: nil, content: nil, error: e.message } end end # # deliver the results # if is_rts deliver_rts email, documents, mail_to else deliver_onward email, documents, mail_to end # # Summarise the processing # logger.info "Results of conversion" documents.each do |doc| if doc[:content].nil? logger.info " #{doc[:orig_filename]} was not converted (#{doc[:error]}) " else logger.info " #{doc[:orig_filename]} was converted successfully" end end documents end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email\n\t\temail_response = EmailHandler.new(email_content).deliver_email\n\t\t\trender text: email_response + \"\\n\"\n\tend", "def process\n return 'OK' if @email.to.first[:token] == 'example'\n return process_image if @email.to.first[:token] == 'flyers'\n\n token = ReplyToken.find(@email.to.first[:token])\n\n case token.reply_type\n when 'participation_request'\n process_participation_request(token)\n when 'conversation'\n process_conversation(token)\n when 'comment'\n process_comment(token)\n when 'community'\n process_community_reply(token)\n end\n\n track_reply(token)\n\n token.use!\n end", "def work(raw_post)\n email_params = JSON.parse(raw_post).with_indifferent_access\n send_simple_message(params)\n ack! # we need to let queue know that message was received\n end", "def send_email(subject_mail_part, attach_file, body_mail_part, email_type, delivery_call, test_subject = nil)\n last_failed_response = nil\n response = nil\n content = attach_file.read unless attach_file.nil?\n @candidates.each do |candidate|\n sg_mail =\n create_mail((test_subject.nil? ? subject_mail_part : MailPart.new_subject(test_subject.call(candidate))),\n email_type, candidate.account_name)\n\n add_attachment_file(attach_file, sg_mail, content) unless attach_file.nil?\n\n create_personalization(candidate, sg_mail, test_subject ? @admin : nil)\n\n expanded_text = expand_text(candidate, subject_mail_part, body_mail_part, delivery_call)\n\n sg_mail.add_content(SendGrid::Content.new(type: 'text/html', value: expanded_text))\n\n response = post_email(sg_mail)\n next if response.status_code[0].to_s == '2'\n\n last_failed_response = response\n account_name = candidate.account_name\n status_code = response.status_code\n log_msg = \"Bad response for #{email_type} message for #{account_name} because of a bad response: #{status_code}\"\n Rails.logger.info(log_msg)\n Rails.logger.info(\"Status=#{response.status_code} body=#{response.body}\")\n end\n last_failed_response || response\n end", "def convert_email filename, in_dir, out_dir, language\n email = Mail.read( File.extname(filename)=='.msg' ? convert_msg(filename, in_dir, out_dir) : filename )\n f_base = filename.gsub /#{File.extname(filename)}$/, ''\n logger.debug \" email file, has #{email.attachments.size} attachments\"\n new_attachments = []\n converter = AutoHeathen::Converter.new( { logger: logger } )\n email.attachments.each do |attachment|\n content = attachment.decoded\n action = converter.get_action content.content_type\n logger.debug \" convert: #{File.basename(filename)}, content_type: #{content.content_type}, action: #{action}\"\n start_time = Time.now\n outfile, data = converter.convert action, language, attachment.filename, content\n logger.debug \" conversion took %0.2f s\"%[Time.now-start_time]\n new_attachments << { filename: File.basename(outfile), data: data }\n end\n email.charset = 'UTF-8' unless email.charset # stop annoying warning message if charset not defined in email\n # Mail#without_attachments! does not work correctly\n #email.without_attachments!\n email.parts.delete_if { |p| p.attachment? }\n new_attachments.each do |na|\n email.attachments[na[:filename]] = na[:data]\n end\n e_filename = to_outfile in_dir, filename, out_dir, \"#{f_base}.eml\"\n logger.debug \" writing #{e_filename} with #{email.attachments.size} converted attachments\"\n File.open( e_filename, 'w' ) do |f|\n f.write email.to_s\n end\nend", "def process_mail(mail, config)\n end", "def process_mail(mail, config)\n end", "def receive_inbound_email_from_mail(**kwargs, &block); end", "def deliver_rts email, documents, mail_to\n logger.info \"Sending response mail to #{mail_to}\"\n mail = Mail.new\n mail.from @cfg[:from]\n mail.to mail_to\n # CCs to the original email will get a copy of the converted files as well\n mail.cc (email.cc - email.to - (@cfg[:cc_blacklist]||[]) ) if email.cc # Prevent autoheathen infinite loop!\n # Don't prepend yet another Re:\n mail.subject \"#{'Re: ' unless email.subject.start_with? 'Re:'}#{email.subject}\"\n # Construct received path\n # TODO: is this in the right order?\n #rcv = \"by localhost(autoheathen); #{Time.now.strftime '%a, %d %b %Y %T %z'}\"\n #[email.received,rcv].flatten.each { |rec| mail.received rec.to_s }\n mail.return_path email.return_path if email.return_path\n mail.header['X-Received'] = email.header['X-Received'] if email.header['X-Received']\n documents.each do |doc|\n next if doc[:content].nil?\n mail.add_file filename: doc[:filename], content: doc[:content]\n end\n cfg = @cfg # stoopid Mail scoping\n me = self # stoopid Mail scoping\n mail.text_part do\n s = Haml::Engine.new( me.read_file cfg[:text_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.html_part do\n content_type 'text/html; charset=UTF-8'\n s = Haml::Engine.new( me.read_file cfg[:html_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port]\n deliver mail\n end", "def receive(email)\n post = Post.new\n\n # Will fail if no matches. Rely on validation\n list_post_header = email.header_string(\"List-Post\")\n matches = list_post_header.match(/<mailto:(\\S+)@/) if list_post_header\n if matches\n mailing_list_name = matches[1]\n else\n mailing_list_name = email.to.first.to_s\n end\n post.mailing_list = MailingList.find_by_name(mailing_list_name)\n\n post.subject = email.subject\n \n if email.multipart?\n plain_text_part = nil\n\n # Outlook\n related_part = email.parts.find { |part| \n part.content_type == \"multipart/related\"\n }\n if related_part\n alt_part = related_part.parts.find { |part| \n part.content_type == \"multipart/alternative\"\n }\n else\n alt_part = email.parts.find { |part| \n part.content_type == \"multipart/alternative\"\n }\n end\n \n # OS X rich text email\n if alt_part \n plain_text_part = alt_part.parts.find { |part| \n part.content_type == \"text/plain\"\n }\n end\n\n plain_text_part = email.parts.find { |part| \n part.content_type == \"text/plain\"\n } unless plain_text_part\n \n plain_text_part = email.parts.find { |part| \n part.content_type == \"text/html\"\n } unless plain_text_part\n \n post.body = plain_text_part.body\n end\n \n if post.body.blank?\n post.body = email.body\n end\n \n post.from_name = email.friendly_from\n post.from_email_address = email.from\n post.date = email.date\n begin\n post.save!\n rescue => save_error\n RACING_ON_RAILS_DEFAULT_LOGGER.error(\"Could not save post: #{save_error}\")\n if post and !post.errors.empty?\n RACING_ON_RAILS_DEFAULT_LOGGER.error(post.errors.full_messages)\n end\n raise\n end\n end", "def handle\n attachments.each do |attachment|\n handle_attachment attachment\n end\n end", "def process_attachment(attachment)\n #first, parse entries\n queue_entries_and_store_total(attachment)\n #next, start job to normalize data\n delay.process_report_entries\n end", "def email_with_attachment(recipient_a, subject_a, user_a, org_fname, file_attach)\n @recipients = recipient_a\n @subject = subject_a\n @from = \"info@nrdpfc.ca\"\n @reply_to = \"info@nrdpfc.ca\"\n @body = subject_a \n part :content_type => \"multipart/mixed\" do |p|\n p.attachment :content_type => \"csv/text\", \n# :body => File.open(\"public/whale_batch.csv\", \"rb\") { |f| f.read },\n :body => file_attach,\n :filename => org_fname,\n :transfer_encoding => \"base64\",\n :charset => \"utf-8\"\n end \n end", "def perform(email, invitor_id, variation_id, with_media)\n end", "def get_email_attachments\n\t\tresp = @resp\n\n\t\tparams[\"email\"] ||= \"\"\n\t\tparams[\"password\"] ||= \"\"\n\n\t\t# Authorize and process attachments in mail account\n\t\tresp = Resume.gmail_attachments(resp, params)\n\n\t\trender :json => resp\n end", "def process_message_body\n @attachments = []\n if @mail.multipart?\n @body, @html = [], []\n scan_parts(@mail)\n @body = @body.join(\"\\n\")\n @html = @html.join(\"\\n\")\n else\n if @mail.content_type =~ /text\\/html/\n @html = @mail.body.to_s\n @body = ''\n else\n @body = @mail.body.to_s\n @html = ''\n end\n end\n\n @body = convert_to_utf8(@body)\n @html = convert_to_utf8(@html)\n end", "def stopped_responses(info_request, email, raw_email_data)\n @from = contact_from_name_and_email\n headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # we don't care about bounces, likely from spammers\n 'Auto-Submitted' => 'auto-replied' # http://tools.ietf.org/html/rfc3834\n @recipients = email.from_addrs[0].to_s\n @subject = \"Your response to an FOI request was not delivered\"\n attachment :content_type => 'message/rfc822', :body => raw_email_data,\n :filename => \"original.eml\", :transfer_encoding => '7bit', :content_disposition => 'inline'\n @body = { \n :info_request => info_request,\n :contact_email => MySociety::Config.get(\"CONTACT_EMAIL\", 'contact@localhost') \n }\n end", "def deliver\n response = Curl.post(BASE_URL + 'messages/send.json', email_json)\n response = JSON.parse(response.body)\n @response = response.is_a?(Array) ? response.first : response\n end", "def sent_with_attachments(email_to, email_from, email, my_attachments = [], assigns = {})\n load_settings\n email_builder = ActionView::Base.new(nil, assigns)\n email_from = email_from.blank? ? Confline.get_value(\"Email_from\") : email_from\n # attachments.each {|attach|\n # attachment :content_type => attach[:content_type], :filename =>attach[:filename] do |a|\n # a.body = attach[:file]\n # end\n # }\n\n if my_attachments and my_attachments.size.to_i > 0\n my_attachments.each { |attach|\n attachments[attach[:filename]] = attach[:file]\n }\n end\n\n mail(:to => email_to, :subject => email.subject,\n :from => \"#{email_from} <#{email_from}>\",\n :body => email_builder.render(\n :inline => nice_body(email.body),\n :locals => assigns),\n :content_type => \"text/#{email.format.to_s}\"\n )\n end", "def process_event(event)\n begin\n from_email = event['msg']['from_email']\n to_email = event['msg']['to'].map(&:first)\n\n # It's only supported to post to one user\n # Format: XXX DASH mail_token\n # FIXME use regex\n # TODO move stuff out of the controller!\n mail_tokens = to_email.collect { |s| s.split('@').first.split('-').last }.compact\n\n user = User.where(mail_token: mail_tokens).first\n # User must own an album\n album_ownership = user ? AlbumOwnership.where(user_id: user.id).first : nil\n\n unless user && album_ownership\n Rails.logger.info \"...No user XOR album found for: #{mail_tokens.join(', ') }\"\n return true\n end\n\n Rails.logger.info \"... importing for #{user.id}\"\n\n (event['msg']['attachments'] || {}).each do |file_name, attachment|\n type = attachment['type']\n extension = file_name.split('.').last\n\n unless ImageFile.extension_supported?(extension) || VideoFile.extension_supported?(extension)\n Rails.logger.info \"...Extension #{type} / #{extension} not supported.\"\n next\n end\n\n decoded = Base64.decode64(attachment['content'])\n sha1 = Digest::SHA1.hexdigest(decoded)\n path = \"/tmp/#{sha1}\"\n FileUtils.mkdir_p path\n Rails.logger.info \"...importing #{file_name} #{decoded.size} bytes into #{path}\"\n\n File.open(\"#{path}/#{file_name}\", 'wb') {|f| f.write(decoded)}\n\n Rails.logger.info '...write successful!'\n\n media = {\n file_name: file_name,\n extension: extension,\n full_path: \"#{path}/#{file_name}\",\n sha1: sha1\n }\n\n enqueue_media(media, user)\n end\n\n rescue Exception => ex\n Rails.logger.error ex\n Rails.logger.error ex.backtrace.to_s\n return nil\n end\n\n true\n end", "def receive(email, raw_email)\n # Find which info requests the email is for\n # We deliberately don't use Envelope-to here, so ones that are BCC\n # drop into the holding pen for checking.\n reply_info_requests = [] # XXX should be set?\n for address in (email.to || []) + (email.cc || [])\n reply_info_request = InfoRequest.find_by_incoming_email(address)\n reply_info_requests.push(reply_info_request) if reply_info_request\n end\n\n # Nothing found, so save in holding pen\n if reply_info_requests.size == 0 \n InfoRequest.holding_pen_request.receive(email, raw_email)\n return\n end\n\n # Send the message to each request, to be archived with it\n for reply_info_request in reply_info_requests\n reply_info_request.receive(email, raw_email)\n end\n end", "def process_and_send_for_one (recipient)\n mail_payload = MailPayload.new(\n :subject => subject(recipient),\n :body => message(recipient),\n :recipient_record => recipient,\n :recipient_type => (recipient_type == 'parent' ? 'guardian' : recipient_type),\n :sender => User.find_by_id(sender_id),\n :hostname => Fedena.hostname,\n :mail_type => :alert,\n :alert_name => alert_name,\n :mail_logger => mail_logger\n )\n mail_payload.send_mail # TODO: handle response\n recipient\n end", "def index\n options = params.dup\n email = options.delete(:email)\n if MailHandler.receive(email, options)\n head :created\n else\n head :unprocessable_entity\n end\n end", "def get_mail_attachments\n Log.add_info(request, params.inspect)\n\n email_id = params[:id]\n\n email = Email.find(email_id)\n if email.nil? or email.user_id != @login_user.id\n render(:text => '')\n return\n end\n\n download_name = \"mail_attachments#{email.id}.zip\"\n zip_file = email.zip_attachments(params[:enc])\n\n if zip_file.nil?\n send_data('', :type => 'application/octet-stream;', :disposition => 'attachment;filename=\"'+download_name+'\"')\n else\n filepath = zip_file.path\n send_file(filepath, :filename => download_name, :stream => true, :disposition => 'attachment')\n end\n end", "def deliver_email\n\t\treturn not_validated_error unless EmailValidator.new(content: content).validated?\n\t\tformatted_content = EmailFormatter.new(content: content, service: service).format\n\n\t\tif service == \"mandrill\"\n\t\t\tself.class.base_uri \"https://mandrillapp.com/api/1.0\"\n\t\t\tresponse = self.class.post(\"/messages/send.json\", body: {\"key\" => ENV.fetch(\"MANDRILL_API_KEY\"), \"message\" => formatted_content})\n\t\t\tif response[\"status\"] == \"sent\"\n\t\t\t\t\"Yay! Your email is on it's way!!\"\n\t\t\telse\n\t\t\t\t\"Oh no. That email couldn't be delivered\"\n\t\t\tend\n\n\t\telsif service == \"mailgun\"\n\t\t\tself.class.base_uri \"https://api.mailgun.net/v3/sandboxaebea391c02a4a0494ab285e2adf8170.mailgun.org\"\n\t\t\tself.class.basic_auth 'api', ENV.fetch(\"MAILGUN_API_KEY\")\n\t\t\tresponse = self.class.post(\"/messages\", body: formatted_content)\n\t\t\tif response[\"message\"] == \"Queued. Thank you.\"\n\t\t\t\t\"Yay! Your email is on it's way!!\"\n\t\t\telse\n\t\t\t\t\"Oh no. That email couldn't be delivered\"\n\t\t\tend\n\t\tend\n\tend", "def yield_email_and_respond_for_report\n csv_send_to_email = params[:email] || current_user.email\n\n yield csv_send_to_email\n\n if request.xhr?\n render plain: I18n.t(\"controllers.reports.mail_queued\", email: csv_send_to_email)\n else\n flash[:notice] = I18n.t(\"controllers.reports.mail_queued\", email: csv_send_to_email)\n redirect_back(fallback_location: url_for)\n end\n end", "def send_mail\n logger.debug \"[send_mail] - Access token: #{session[:access_token]}\"\n\n # Used in the template\n @name = session[:name]\n @email = params[:specified_email]\n @recipient = params[:specified_email]\n @mail_sent = false\n\n send_mail_endpoint = URI(\"#{GRAPH_RESOURCE}#{SENDMAIL_ENDPOINT}\")\n content_type = CONTENT_TYPE\n http = Net::HTTP.new(send_mail_endpoint.host, send_mail_endpoint.port)\n http.use_ssl = true\n\n # If you want to use a sniffer tool, like Fiddler, to see the request\n # you might need to add this line to tell the engine not to verify the\n # certificate or you might see a \"certificate verify failed\" error\n # http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n email_body = File.read('app/assets/MailTemplate.html')\n email_body.sub! '{given_name}', @name\n email_subject = t('email_subject')\n\n logger.debug email_body\n\n email_message = \"{\n Message: {\n Subject: '#{email_subject}',\n Body: {\n ContentType: 'HTML',\n Content: '#{email_body}'\n },\n ToRecipients: [\n {\n EmailAddress: {\n Address: '#{@recipient}'\n }\n }\n ]\n },\n SaveToSentItems: true\n }\"\n\n response = http.post(\n SENDMAIL_ENDPOINT,\n email_message,\n 'Authorization' => \"Bearer #{session[:access_token]}\",\n 'Content-Type' => content_type\n )\n\n logger.debug \"Code: #{response.code}\"\n logger.debug \"Message: #{response.message}\"\n\n # The send mail endpoint returns a 202 - Accepted code on success\n if response.code == '202'\n @mail_sent = true\n else\n @mail_sent = false\n flash[:httpError] = \"#{response.code} - #{response.message}\"\n end\n\n render 'callback'\n end", "def process\n parsed = {}\n parsed[:contents] = \"#{@email.subject} ::: #{@email.body}\"\n parsed[:from] = \"#{@email.from[:email]}\"\n #[:to] is an array of hashes, since possible multiple to's\n parsed[:to] = \"#{@email.to[0][:email]}\"\n\n email_of_interest = parsed[:to]\n if !(/@/.match(parsed[:to]))\n Rails.logger.warn \"Poorly formatted email! parsed: #{parsed}\"\n end\n\n object = Person.react_to_email(email_of_interest)\n if object.class.to_s == \"Person\"\n Communication.create(person_id: object.id,\n contents: parsed[:contents],\n medium: \"email\",\n when: Date.today)\n end\n end", "def send_mail(mail_from, mail_to, mail_subject, mail_attachment = nil, type = nil, mail_body = nil)\n begin\n attached_file = ''\n if !mail_attachment.nil?\n LoggerHelper.log_debug('rqa.log', 'Absolute path to attachment: ' + mail_attachment, __FILE__, __LINE__)\n\n ext = ApplicationHelper.get_rqa_config('attachment_extension')\n LoggerHelper.log_debug('rqa.log', 'Attachment extension in config: ' + ext, __FILE__, __LINE__)\n\n attached_file = File.basename(mail_attachment).gsub('.zip', '.' + ext)\n LoggerHelper.log_debug('rqa.log', 'Attachment file: ' + attached_file, __FILE__, __LINE__)\n\n attachments.inline[attached_file] = File.read(mail_attachment, mode: 'rb')\n LoggerHelper.log_info('rqa.log', 'Read attachment: done.', __FILE__, __LINE__)\n end\n if !type.nil?\n header = '{\"COMPANY\": \"WALLEM\", \"APPLICATION\": \"TPS RQA\", \"TYPE\": \"'\n header += type.to_s.upcase\n header += '\", \"VERSION\": \"<TBD>\", \"COMMENT\": \"<TBD>\"}'\n LoggerHelper.log_debug('rqa.log', 'HEADER: ' + header, __FILE__, __LINE__)\n\n headers['X-CUSTOM'] = header\n LoggerHelper.log_info('rqa.log', 'Write custom header: done.', __FILE__, __LINE__)\n end\n\n LoggerHelper.log_debug('rqa.log', 'Sent mail. FROM: ' + mail_from, __FILE__, __LINE__)\n LoggerHelper.log_debug('rqa.log', 'Sent mail. TO: ' + mail_to, __FILE__, __LINE__)\n LoggerHelper.log_debug('rqa.log', 'Sent mail. SUBJECT: ' + mail_subject, __FILE__, __LINE__)\n LoggerHelper.log_debug('rqa.log', 'Sent mail. ATTACHMENT: ' + attached_file, __FILE__, __LINE__)\n\n if mail_body.nil?\n LoggerHelper.log_info('rqa.log', 'Body is null => using body template.', __FILE__, __LINE__)\n mail(from: mail_from, to: mail_to, subject: mail_subject).deliver!\n else\n mail(from: mail_from, to: mail_to, subject: mail_subject, body: mail_body).deliver!\n end\n LoggerHelper.log_info('rqa.log', 'Sent mail: done and successfully.', __FILE__, __LINE__)\n rescue => ex\n LoggerHelper.log_error('rqa.log', ex.message, __FILE__, __LINE__)\n LoggerHelper.log_error('rqa.log', ex.backtrace.join(\"\\n\").to_s, __FILE__, __LINE__)\n return false\n end\n return true\n end", "def process_emails(reader_info)\n notifications = reader_info.notifications\n notifications.each do |notification|\n case notification[:notification_type]\n when \"email\"\n send_email(reader_info) if notification[:checked]\n when \"internal\"\n send_internal(reader_info) if notification[:checked]\n when \"sms\"\n send_sms(reader_info) if notification[:checked]\n when \"e-boks\"\n send_e_boks(reader_info) if notification[:checked]\n end\n end\n end", "def done(parse)\n @greeting = \"Job is done\"\n @parse = parse\n attachments[parse.result_f_file_name] = File.read(parse.result_f.path)\n mail to: \"augerdownbooks@gmail.com\", from: \"shawnzam@gmail.com\", subject: \"foof\"\n \n # attachments[report.pdf_file_file_name] = File.read(report.pdf_file.path)\n end", "def deliver_onward email, documents, mail_to\n logger.info \"Sending response mail to #{mail_to}\"\n email.cc [] # No CCing, just send to the recipient\n email.to mail_to\n email.subject \"#{'Fwd: ' unless email.subject.to_s.start_with? 'Fwd:'}#{email.subject}\"\n email.return_path email.from unless email.return_path\n # something weird goes on with Sharepoint, where the doc is dropped on the floor\n # so, remove any offending headers\n email.message_id = nil # make sure of message_id too\n good_headers = ONWARD_HEADERS.map{ |h| h.downcase }\n inspect_headers = email.header.map(&:name)\n inspect_headers .each do |name|\n unless good_headers.include? name.downcase \n email.header[name] = nil\n end\n end\n email.received = nil # make sure of received\n # replace attachments with converted files\n email.parts.delete_if { |p| p.attachment? }\n documents.each do |doc|\n if doc[:content]\n email.add_file filename: doc[:filename], content: doc[:content]\n else # preserve non-converted attachments when forwarding\n email.add_file filename: doc[:orig_filename], content: doc[:orig_content]\n end\n end\n email.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port]\n deliver email\n end", "def send_email_if_needed\n \tif self.is_response\n \t\tlogger.info \"Send Email\"\n \t\tMessageMailer.reply_email( self ).deliver\n \tend\n end", "def create\n @email_submission = EmailSubmission.new(params[:email_submission])\n email = @email_submission.email_id\n message = @email_submission.email_message_id\n server = @email_submission.server_id\n delivered = false \n\n respond_to do |format|\n if @email_submission.save\n #@email_submission.deliver(server, email, message)\n format.html { redirect_to email_submissions_url, notice: 'Email submission was successfully created.' }\n format.json { render json: @email_submissions, status: :created, location: @email_submission }\n else\n format.html { render action: \"new\" }\n format.json { render json: @email_submission.errors, status: :unprocessable_entity }\n end\n end\n end", "def handle(uids)\n each_message uids, 'text/plain' do |uid, mail|\n @mail = mail\n @url = nil\n @description = nil\n\n case mail.from.first\n when 'A2ATransfer@us.hsbc.com' then\n next false unless handle_a2atransfer\n when 'alerts@email.hsbcusa.com' then\n next false unless handle_alert\n when 'HSBC@email.hsbcusa.com' then\n next false unless handle_hsbc\n else\n log \"Unknown From: #{mail.from.join ', '}\"\n next false\n end\n\n add_item mail.subject, @description, mail.from, mail.date, @url,\n mail.message_id, 'HSBC'\n end\n end", "def create\n @email = Email.create(filtered_params)\n @email.dispatch\n respond_with @email\n end", "def package\n raise \"Missing from address\" if self.from.nil?\n\n begin \n @envelope = TMail::Mail.new()\n rescue => e\n begin\n require 'tmail'\n @envelope = TMail::Mail.new()\n rescue MissingSourceFile, Gem::LoadError => e\n logger.error(\"TMail Gem wasn't found. Please install if you want to send mail.\")\n end\n end\n \n # http://tmail.rubyforge.org/rdoc/index.html\n @envelope.mime_version = \"1.0\"\n @envelope.charset = self.charset\n @envelope.message_id = self.message_id\n @envelope.from = [self.from]\n @envelope.to = [self.to] if self.to\n @envelope.cc = [self.cc] if self.cc\n @envelope.bcc = [self.bcc] if self.bcc\n @envelope.date = self.date\n @envelope.subject = self.subject\n \n html = TMail::Mail.new()\n html.body = self.render_result\n html.set_content_type('text','html')\n \n @envelope.parts << html\n @envelope.set_content_type('multipart', 'mixed') # needs to be set last or throws an error\n end", "def process_mailbox\n handler.process\n end", "def general_email(addresses, subject_line, body_content, article_content=nil)\n \n if article_content != nil\n attachments.inline['attachment.txt'] = article_content\n end \n \n @content = body_content\n \n #TODO check that email is creatible, ie has valid addresses\n mail(:to => addresses, :subject => subject_line)\n \n end", "def receive(email, options={})\n @email = email\n @handler_options = options\n sender_email = email.from.to_a.first.to_s.strip\n # Ignore emails received from the application emission address to avoid hell cycles\n if sender_email.casecmp(Setting.mail_from.to_s.strip) == 0\n if logger\n logger.info \"MailHandler: ignoring email from Redmine emission address [#{sender_email}]\"\n end\n return false\n end\n # Ignore auto generated emails\n self.class.ignored_emails_headers.each do |key, ignored_value|\n value = email.header[key]\n if value\n value = value.to_s.downcase\n if (ignored_value.is_a?(Regexp) && value.match(ignored_value)) || value == ignored_value\n if logger\n logger.info \"MailHandler: ignoring email with #{key}:#{value} header\"\n end\n return false\n end\n end\n end\n @user = User.find_by_mail(sender_email) if sender_email.present?\n if @user && !@user.active?\n if logger\n logger.info \"MailHandler: ignoring email from non-active user [#{@user.login}]\"\n end\n return false\n end\n if @user.nil?\n # Email was submitted by an unknown user\n case handler_options[:unknown_user]\n when 'accept'\n @user = User.anonymous\n when 'create'\n @user = create_user_from_email\n if @user\n if logger\n logger.info \"MailHandler: [#{@user.login}] account created\"\n end\n add_user_to_group(handler_options[:default_group])\n unless handler_options[:no_account_notice]\n Mailer.account_information(@user, @user.password).deliver\n end\n else\n if logger\n logger.error \"MailHandler: could not create account for [#{sender_email}]\"\n end\n return false\n end\n else\n # Default behaviour, emails from unknown users are ignored\n if logger\n logger.info \"MailHandler: ignoring email from unknown user [#{sender_email}]\"\n end\n return false\n end\n end\n User.current = @user\n dispatch\n end", "def process_email(email, subscriber)\n recipients = list.recipients(subscriber)\n process_message messages.build(\n :mail_list => self,\n :subscriber => subscriber,\n :recipients => recipients,\n :email => email\n ), :copy_sender => list.copy_sender?(subscriber)\n end", "def do_smtp(mail_account)\n\n recipients = []\n\n if self.to_addresses.nil? or self.to_addresses.empty?\n email_to = nil\n else\n email_to = self.get_to_addresses\n recipients.concat(email_to)\n email_to.map! { |addr|\n EmailsHelper.encode_disp_name(addr)\n }\n end\n if self.cc_addresses.nil? or self.cc_addresses.empty?\n email_cc = nil\n else\n email_cc = self.get_cc_addresses\n recipients.concat(email_cc)\n email_cc.map! { |addr|\n EmailsHelper.encode_disp_name(addr)\n }\n end\n if self.bcc_addresses.nil? or self.bcc_addresses.empty?\n email_bcc = nil\n else\n email_bcc = self.get_bcc_addresses\n recipients.concat(email_bcc)\n end\n\n sender = self.from_address\n email_from = EmailsHelper.encode_disp_name(sender)\n\n if !self.reply_to.nil? and !self.reply_to.empty?\n reply_to = self.reply_to\n elsif !mail_account.reply_to.nil? and !mail_account.reply_to.empty?\n reply_to = EmailsHelper.encode_disp_name(mail_account.reply_to)\n else\n reply_to = nil\n end\n\n if mail_account.organization.nil? or mail_account.organization.empty?\n organization = nil\n else\n organization = EmailsHelper.encode_b(mail_account.organization)\n end\n\n has_attach = !(self.mail_attachments.nil? or self.mail_attachments.empty?)\n boundary = Digest::SHA1.hexdigest(Time.now.to_f.to_s)\n\n email_content = ''\n email_content << \"From: #{email_from}\\n\"\n unless email_to.nil?\n email_content << \"To: #{email_to.join(\",\\n \")}\\n\"\n end\n unless email_cc.nil?\n email_content << \"Cc: #{email_cc.join(\",\\n \")}\\n\"\n end\n unless reply_to.nil?\n email_content << \"Reply-To: #{reply_to}\\n\"\n end\n unless organization.nil?\n email_content << \"Organization: #{organization}\\n\"\n end\n email_content << \"Subject: #{EmailsHelper.encode_b(self.subject)}\\n\"\n email_content << \"Date: #{Time::now.strftime('%a, %d %b %Y %X %z')}\\n\"\n email_content << \"Mime-Version: 1.0\\n\"\n email_content << \"User-Agent: Thetis\\n\"\n if has_attach\n email_content << \"Content-Type: multipart/mixed; boundary=#{boundary}\\n\"\n email_content << \"\\n\"\n email_content << \"--#{boundary}\\n\"\n end\n email_content << \"Content-Type: text/plain; charset=utf-8\\n\"\n email_content << \"Content-Transfer-Encoding: base64\\n\"\n email_content << \"\\n\"\n email_content << \"#{[self.message].pack('m')}\\n\"\n=begin\n email_content << <<EOT\n#{Base64::encode64(self.message).scan(/.{1,60}/).join(\"\\n\")}\nEOT\n=end\n\n# logger.fatal email_content\n\n if has_attach\n email_content << \"\\n\"\n self.mail_attachments.each do |mail_attach|\n attach_name = EmailsHelper.encode_b(mail_attach.name)\n\n attach_content = File.open(mail_attach.get_path).readlines.join('')\n\n email_content << \"--#{boundary}\\n\"\n email_content << \"Content-Type: application/octet-stream;\\n\"\n email_content << \" name=\\\"#{attach_name}\\\"\\n\"\n email_content << \"Content-Disposition: attachment;\\n\"\n email_content << \" filename=\\\"#{attach_name}\\\"\\n\"\n email_content << \"Content-Transfer-Encoding: base64\\n\"\n email_content << \"\\n\"\n email_content << \"#{[attach_content].pack('m')}\\n\"\n end\n email_content << \"--#{boundary}--\\n\"\n end\n\n # Do SMTP\n smtp = Net::SMTP.new(mail_account.smtp_server, mail_account.smtp_port)\n\n case mail_account.smtp_secure_conn\n when MailAccount::SMTP_SECURE_CONN_STARTTLS\n context = Net::SMTP.default_ssl_context\n context.verify_mode = OpenSSL::SSL::VERIFY_NONE\n smtp.enable_starttls(context)\n # smtp.enable_starttls_auto \n\n when MailAccount::SMTP_SECURE_CONN_SSL_TLS\n smtp.enable_ssl(OpenSSL::SSL::VERIFY_NONE)\n end\n\n if mail_account.smtp_auth\n smtp.start('localhost.localdomain', mail_account.smtp_username, mail_account.smtp_password, mail_account.smtp_auth_method) do |_smtp|\n _smtp.sendmail(email_content, sender, recipients.uniq)\n end\n else\n smtp.start do |_smtp|\n _smtp.sendmail(email_content, sender, recipients.uniq)\n end\n end\n\n begin\n self.save_raw(email_content)\n rescue => evar\n Log.add_error(nil, evar)\n end\n end", "def perform(email, job_id)\n if email.blank? or job_id.blank?\n puts(\"Either of job or email is blank. Email: #{email}, Job: #{job_id}\")\n return\n end\n\n email_invitations = EmailInvitation.where(:email => email)\n email_invitation = nil\n email_invitations.each do |invitation|\n unless invitation[:invitor_handle].blank?\n email_invitation = invitation\n end\n end\n\n if !email_invitations.blank? and email_invitation.blank?\n email_invitation = email_invitations[0]\n end\n\n if email_invitation.blank?\n email_invitation = create_email_invitation_for_email(email, nil)\n end\n\n if email_invitation.reminder_count >= 3\n puts(\"Reminder count exceeded for user: #{email}\")\n return\n end\n\n job = get_job_by_id(job_id)\n if job.blank? or !job.live\n puts(\"Either Job is blank or not live. live? #{job.live}\")\n return\n end\n\n email_variation_id = get_job_email_variation\n user = get_user_by_email(email)\n if user.blank?\n user = create_passive_user(email)\n elsif user[:active]\n puts(\"USER (#{user})is active returning from not sending invitation\")\n return\n end\n begin\n Notifier.email_job_invitation(user, '', job, email_variation_id).deliver\n rescue Exception => ex\n puts \"Exception: #{ex}\"\n end\n\n email_invitation.last_variation_used = email_variation_id\n email_invitation.time = Time.now\n email_invitation.reminder_count = email_invitation.reminder_count + 1\n email_invitation.save\n track_email_send(\"track_job_email_#{job_id}_#{email_variation_id}\")\n end", "def start(password)\n\n # This checks to make sure a user has uploaded data to be sent\n if data.blank?\n return { success: false, message: \"Please upload data to send emails!\" } \n end\n \n # This is an initalization of the lists of items that will be sent to the mailer\n emails = []\n subjects = []\n templates = []\n files = campaign.file_paths\n\n # Parse the CSV and aquire the headers\n rows = CSV.parse(data, headers: true)\n headers = rows.headers\n\n # Iterate through the rows in the CSV\n rows.each_with_index do |row, index|\n # Seed the subjects and templates with the default data\n subjects[index] = subject\n templates[index] = template.gsub(\"<p><br></p>\", \"\")\n\n # Iterate through each of the columsn in the row\n headers.each do |header|\n # Clean the header by parametrizing it and changing dashes to underscores\n cleanHeader = header.parameterize.underscore\n\n # Check if you are in the email column\n if cleanHeader == \"email\"\n # If you are in the email column, and the email is not a valid email, stop the sending process\n if !valid_email?(row[header])\n return { success: false, message: \"You seem to have invalid emails in your CSV. Please reupload and try again!\" } \n end\n\n # Add the current email to email list\n emails << row[header]\n end \n\n # Update the template at the proper index with the variables filled in\n subjects[index] = subjects[index].gsub(\"{{#{cleanHeader}}}\", row[header]) \n templates[index] = templates[index].gsub(\"{{#{cleanHeader}}}\", row[header]) \n end\n end\n\n # Calls email service to mass send the emails (or at least start the process)\n send_email = EmailService.bulk_email(credential, emails, subjects, templates, files, password)\n\n # If email sending process was started, return true, otherwise return false and message\n if send_email[:success]\n return { success: true }\n else\n return { success: false, message: send_email[:message] }\n end\n end", "def send(email, options={})\n options = {\n :subject => '',\n :body => '',\n :html => 1,\n :eid => @@config[:defaults][:eid], \n :aid => @@config[:defaults][:aid],\n :test => @@config[:defaults][:test]\n }.merge(options)\n # Check APIebmtrigger documentation for full list of optional paramiters\n \n params = [\n Curl::PostField.content('email', email),\n Curl::PostField.content('eid', options.delete(:eid)),\n Curl::PostField.content('SUBJECT_LINE', options.delete(:subject)),\n Curl::PostField.content('CONTENT', options.delete(:body)),\n Curl::PostField.content(\"HTML\", options.delete(:html).to_s ) ]\n options.each { |k, v| params << Curl::PostField.content(k.to_s, v) }\n \n # connection.verbose = true # for debugging\n connection.url = \"https://trig.em.visa.com/ebm/ebmtrigger1\"\n connection.http_post(\"https://trig.em.visa.com/ebm/ebmtrigger1\", params )\n \n # return \n connection.body_str.match(/\\s*OK\\s*/) ? true : #or\n connection.response_code==200 ? raise( \"API Error - #{connection.body_str}\") : #or\n raise( \"Server Error - Responce Code #{@connection.response_code}\" )\n end", "def application_request\n\t\tPony.mail(to: params[:email], from: \"bradwflint@gmail.com\", subject: \"Email application\", body: \"Here is the rental application!\", :attachments => {\"rentalapp.pdf\" => File.read(Rails.root.to_s + \"/public/rentalapp.pdf\")} )\n\t # Pony.mail(to: \"bradwflint@gmail.com\", from: \"bradwflint@gmail.com\", subject: \"Email application\", body: \"Here is the rental application!\", :attachments => {\"rentalapp.pdf\" => File.read(Rails.root.to_s + \"/public/rentalapp.pdf\")} )\n\t\tredirect_to properties_apply_path\n\tend", "def save_files\n\n return if @mail.nil?\n\n path = self.get_dir\n FileUtils.mkdir_p(path)\n\n # Raw data\n self.save_raw(@mail.raw_source)\n\n # Attachment files\n\n return unless @mail.has_attachments?\n\n attach_cnt = 0\n\n @mail.attachments.each_with_index do |attach, idx|\n\n mail_attachment = MailAttachment.new\n mail_attachment.email_id = self.id\n begin\n mail_attachment.name = Mail::Encodings.decode_encode(attach.filename, :decode)\n rescue => evar\n # for Platform dependent characters in ISO-2022-JP >>>\n mail_attachment.name = EmailsHelper.decode_b(attach.filename)\n # for Platform dependent characters in ISO-2022-JP <<<\n end\n mail_attachment.content_type = attach.content_type\n\n temp = Tempfile.new('thetis_mail_part', path)\n temp.binmode\n temp.write(attach.body.decoded)\n mail_attachment.size = temp.size\n\n temp.close(false)\n\n mail_attachment.save!\n\n FileUtils.mv(temp.path, File.join(path, mail_attachment.id.to_s + File.extname(mail_attachment.name)))\n\n attach_cnt += 1\n end\n end", "def save_attachments(thismail)\n if thismail.has_attachments?\n # list the attachments & save them\n thismail.attachments.each_with_index do |att,idx|\n if att.content_type.start_with?(\"image/\")\n filename = att.filename.gsub(/[^0-9a-z. ]/i, ' ')\n filename = filename.split(\" \").join(\"-\")\n cid = att.content_id.to_s.delete(\"<>\")\n @atts[\"image#{idx}\".to_sym] = {filename: filename, cid: cid, content: att.body.decoded, type: att.content_type}\n end\n end\n end\n end", "def process_mail(mail)\n @files_to_commit = []\n keyvals = {\n :tags => \"\", # a YAML array\n :markup => @blog.markup,\n :slug => nil,\n :published => true,\n :layout => \"post\",\n }\n\n subject = mail.subject\n\n return false unless is_subject_valid?(subject, keyvals)\n\n # vvv -- updates the contents of keyvals\n # and adds kevals[:title]\n keyvals = extract_data_from_subject(subject, keyvals)\n return false unless is_secret_valid?(@blog, keyvals[:secret], subject)\n @logger.log(\"XXX secret was valid\")\n keyvals = update_and_infer_keyvals(@blog, keyvals)\n body = \"\"\n images_needing_replacement = {}\n if mail.multipart?\n #vvv updates images_needing_replacement\n body = process_multipart_mail(mail, body, images_needing_replacement, keyvals)\n else\n #Just grab the body no matter what it is\n body = mail.body.decoded\n end\n #If we have no body after all that, bail\n @logger.log(\"XXX will return if body empty\")\n return false if body.strip.empty?\n\n @logger.log(\"XXX body wasn't empty\")\n\n body = cleanup_html_and_replace_images(\n body,\n keyvals[:markup],\n images_needing_replacement\n )\n\n @logger.log(\"XXX calling write_to_disk\")\n write_to_disk(body, keyvals)\n @logger.log(\"XXX wrote to disk\")\n\n log_files_to_commit(@files_to_commit) if @files_to_commit.size > 0\n\n\n if @blog.add_to_git? and @files_to_commit.size() > 0\n @blog.commit(@files_to_commit, keyvals[:slug])\n end\n\n return @files_to_commit.size > 0\n end", "def send_email_admin(subject_mail_part, body_mail_part, attach_file_path)\n email_type = EmailStuff::TYPES[:email_error_message]\n sg_mail = create_mail(subject_mail_part, email_type, @admin.name)\n\n add_attachment_file_xlxs(File.new(attach_file_path), sg_mail, attach_file_path) unless attach_file_path.nil?\n\n create_personalization(nil, sg_mail, @admin)\n\n sg_mail.add_content(SendGrid::Content.new(type: 'text/html', value: body_mail_part))\n\n response = post_email(sg_mail)\n\n handle_bad_response(response, email_type, @admin.name)\n\n response\n end", "def processAttachmentMessage(message)\r\n attachmentName = message[:attachment]\r\n attachmentFileType = Pathname.new(attachmentName).extname\r\n\r\n if @options[:renameAttachments]\r\n @attachmentCounter = @attachmentCounter + 1\r\n outputFileName = message[:timestamp].strftime(\"%Y-%m-%d\")\r\n outputFileName << \"-%05d\" % @attachmentCounter\r\n outputFileName << attachmentFileType\r\n else\r\n outputFileName = Pathname.new(attachmentName).basename.to_s\r\n end\r\n\r\n outputPath = @outputDir.join(outputFileName)\r\n\r\n case (attachmentFileType)\r\n when \".jpg\", \".jpeg\", \".png\", \".thumb\" then\r\n html = processImageAttachmentMessage(message[:inputFile], attachmentName, outputFileName)\r\n when \".mp4\" then\r\n html = processVideoAttachmentMessage(attachmentName, outputFileName)\r\n when \".opus\", \".mp3\", \".3gp\", \".m4a\" then\r\n html = processAudioAttachmentMessage(attachmentName, outputFileName)\r\n else\r\n html = processGenericAttachmentMessage(attachmentName, outputFileName)\r\n end\r\n\r\n @attachments << [ message[:inputFile], attachmentName, outputPath ]\r\n return html\r\n end", "def complete_post_processing_tasks\n process_incident_issues if process_issues?\n send_alert_email if send_email? && notifying_alert?\n end", "def send_notification\n @emails = EmployeeEmail.all\n if @emails == []\n return\n else\n #rather unwise to have my api key just sitting here in the code, need to check if a new api-key can be generated\n RestClient.post \"https://api:key-5f4ada711a8a86a1292bcfe23aa9d0aa\"\\\n \"@api.mailgun.net/v2/sandbox3fcc0ad1e9ee457da78753f228405f7e.mailgun.org/messages\",\n :from => \"Excited User <mailgun@sandbox3fcc0ad1e9ee457da78753f228405f7e.mailgun.org>\",\n :to => send_who_us,\n :subject => \"Ovuline Notification Test\",\n #ack! I need to find a way to get @company info into this next line\n :text => \"This is the Ovuline Notification System test message! A company (need to make this more specific) has submitted information to the Quotes Table! Is that former sentence incomplete or otherwise incorrect? Oh no! A bug!\"\n end\n end", "def send_mail_from_raw_mime(params)\n begin\n raw_message = \"From: #{params[:sender_email]}\\nTo: #{params[:recipient]}\\nSubject: #{params[:subject].to_s}\\n\\n #{params[:content].to_s}\"\n\n from_email = params[:sender_email]#\"sender@example.com\"\n from_name = \"From Name\"\n to = params[:recipient]#[\"recipient.email@example.com\"]\n async = false\n ip_pool = \"Main Pool\"\n send_at = params[:send_at].presence || Time.now#\"example send_at\"\n return_path_domain = nil\n result = @mandrill.messages.send_raw raw_message, from_email, from_name, to, async, ip_pool, send_at, return_path_domain\n # [{\"reject_reason\"=>\"hard-bounce\",\n # \"email\"=>\"recipient.email@example.com\",\n # \"_id\"=>\"abc123abc123abc123abc123\",\n # \"status\"=>\"sent\"}]\n\n rescue Mandrill::Error => e\n # Mandrill errors are thrown as exceptions\n puts \"A mandrill error occurred: #{e.class} - #{e.message}\"\n # A mandrill error occurred: Mandrill::UnknownSubaccountError - No subaccount exists with the id 'customer-123'\n raise\n end\n end", "def email\n\n email = email_params\n ContactMailer.status_email(email[:email], email[:subject], email[:body]).deliver\n render nothing: true, status: 200\n\n # put logic for sending an email\n # TODO: send the email here.\n end", "def send_email_by_passing_file(sendto, attachmnent_filename, path='./public')\n Pony.mail({\n :to => sendto,\n :from => 'Magic Team',\n :subject => 'Your web scrapper successfully finished',\n :body => 'Thanks for using web scrapper service offered by MAGiC',\n :attachments => {attachmnent_filename => File.read(File.join(path, attachmnent_filename))},\n :via => :smtp,\n :via_options => {\n :address => 'smtp.gmail.com',\n :port => '587',\n :enable_starttls_auto => true,\n :user_name => 'osu.magic.team@gmail.com',\n :password => 'OSUCSE3901',\n :authentication => :plain, # :plain, :login, :cram_md5, no auth by default\n :domain => \"localhost.localdomain\" # the HELO domain provided by the client to the server\n },\n })\n end", "def adhoc_mailing_update\n expected_params = { mail: %i[subject body_input],\n candidate: [:candidate_ids] }\n missing_params = expected_params.select { |expected_param, _sub_params| params[expected_param].nil? }\n\n alert_msg = \"The following required parameters are missing: #{missing_params}\"\n return redirect_to :back, alert: alert_msg unless missing_params.empty?\n\n commit = params.require(:commit)\n\n mail_param = params.require(:mail).permit(:subject, :body_input, :attach_file)\n\n subject_mail_part = MailPart.new_subject(mail_param[:subject])\n body_mail_part = MailPart.new_body(mail_param[:body_input])\n attach_file = mail_param[:attach_file]\n\n candidate_ids = params[:candidate][:candidate_ids]\n candidates = []\n candidate_ids.each { |id| candidates << Candidate.find(id) unless id.empty? }\n\n if candidates.empty?\n setup_adhoc_render(body_mail_part, subject_mail_part)\n flash.now[:alert] = t('messages.no_candidate_selected')\n return render :adhoc_mailing\n end\n begin\n send_grid_mail = SendGridMail.new(current_admin, candidates)\n\n case commit\n when t('email.adhoc_mail')\n flash_message = t('messages.adhoc_mailing_progress')\n response = send_grid_mail.adhoc(subject_mail_part, attach_file, body_mail_part)\n\n when t('email.test_adhoc_mail')\n flash_message = t('messages.adhoc_mailing_test_sent')\n response = send_grid_mail.adhoc_test(subject_mail_part, attach_file, body_mail_part)\n\n else\n\n return redirect_to :back, alert: \"Unknown submit button: #{parm[:commit]}\"\n\n end\n\n if response.status_code[0] == '2'\n flash.now[:notice] = flash_message\n else\n flash[:alert] = \"Status=#{response.status_code} body=#{response.body}\"\n end\n rescue StandardError => e\n flash[:alert] = \"message=#{e.message} backtrace=#{e.backtrace[0...5]}\"\n Rails.logger.error(\"message=#{e.message} backtrace=#{e.backtrace[0...5]}\")\n end\n\n setup_adhoc_render(body_mail_part, subject_mail_part)\n render :adhoc_mailing\n end", "def post(email_or_attributes)\n email = email_or_attributes\n email = MList::EmailPost.new(email_or_attributes) unless email.is_a?(MList::EmailPost)\n process_message messages.build(\n :parent => email.reply_to_message,\n :parent_identifier => email.parent_identifier,\n :mail_list => self,\n :subscriber => email.subscriber,\n :recipients => list.recipients(email.subscriber),\n :email => MList::Email.new(:source => email.to_s)\n ), :search_parent => false, :copy_sender => email.copy_sender\n end", "def adhoc_test(subject_mail_part, attach_file, body_mail_part)\n send_email(subject_mail_part, attach_file, body_mail_part, EmailStuff::TYPES[:adhoc_test],\n adhoc_test_call,\n adhoc_test_subj_call)\n end", "def adhoc(subject_mail_part, attach_file, body_mail_part)\n send_email(subject_mail_part,\n attach_file,\n body_mail_part,\n EmailStuff::TYPES[:adhoc],\n adhoc_call)\n end", "def job_posted_pending(recipient, company, sent_at = Time.now)\n subject \"#{AppConfig.site_name} - Thanks for Posting\"\n recipients recipient\n from AppConfig.from_email\n sent_on sent_at\n content_type \"multipart/alternative\"\n\n part :content_type => \"text/plain\",\n :body => render_message(\"job_posted_pending\", :company => company)\n end", "def send_email_on_human_data(email_data)\n # MAILER: Enable mailer so it can send out the email\n ActionMailer::Base.perform_deliveries = true\n\n # USER: Get user in a list to send\n email_recipients = User.where(username: curation_concern.admin_set.edit_users).map(&:email)\n\n # DELIVER: Delivering the email to the reviewer\n email_recipients.each do |i|\n ScholarsArchive::HumanDataMailer.with(user_mail: i, data: email_data).email_on_human_data.deliver_now\n end\n end", "def attach_results\n # if @asq.result && @asq.result.is_json? && @email_delivery.attach_results\n if @asq.result && @asq.result.is_json? && @email_delivery.attach_results\n attachments[@asq.get_processed_filename] = @asq.to_csv\n end\n end", "def sendEmailMessage(template_to_use)\n puts \"Sending Email Message to User\" if @debug_logging_enabled\n begin\n\n # Create SMTP Defaults hash\n smtp_defaults = {\n :address => @smtp_server,\n :port => @smtp_port,\n :authentication => @smtp_auth_type,\n :enable_starttls_auto => @smtp_tls\n }\n\n # Unless there was not a user specified\n unless @smtp_username.nil? || @smtp_username.empty?\n # Set the email authentication\n smtp_defaults[:user_name] = @smtp_username\n smtp_defaults[:password] = @smtp_password\n end\n\n Mail.defaults do\n delivery_method :smtp, smtp_defaults\n end\n\n # Send out Message VIA SMTP\n to = @recipient_json[\"smtpaddress\"]\n from = @smtp_from\n display_name = @smtp_from\n subject = template_to_use[\"Subject\"]\n htmlbody = template_to_use[\"HTML Content\"]\n textbody = template_to_use[\"Text Content\"]\n\n mail = Mail.new do\n from \"#{display_name} <#{from}>\"\n to \"#{to}\"\n subject \"#{subject}\"\n\n text_part do\n body \"#{textbody}\"\n end\n end\n \n\n # Embed linked images into the html body if present\n unless htmlbody.nil? || htmlbody.empty?\n # Initialize a hash of image links to embeded values\n embedded_images = {}\n\n # Iterate over the body and embed necessary images\n htmlbody.scan(/\"cid:(.*)\"/) do |match|\n # The match variable is an array of Regex groups (specified with\n # parentheses); in this case the first match is the url\n url = match.first\n # Unless we have already embedded this url\n unless embedded_images.has_key?(url)\n cid = embed_url(mail,url)\n embedded_images[url] = cid\n end\n end\n\n # Replace the image URLs with their embedded values\n embedded_images.each do |url, cid|\n htmlbody.gsub!(url, cid)\n end\n\n mail.html_part do\n content_type \"text/html; charset=UTF-8\"\n body \"#{htmlbody}\"\n end\n end\n \n if !template_to_use[\"Attachments\"].nil?\n mail = apply_attachments(mail, template_to_use[\"Attachments\"])\n end\n\n puts \"Delivering the mail\" if @debug_logging_enabled\n mail.deliver\n\n if !mail.bounced?\n puts \"Mail message: #{mail.inspect}\" if @debug_logging_enabled\n return { \"message_id\" => mail.message_id }\n else\n send_error = <<-LOGGING\nThere was an error sending the email message\n Bounced?: #{mail.bounced?}\n Final Recipient: #{mail.final_recipient}\n Action: #{mail.action}\n Error Status: #{mail.error_status}\n Diagnostic Code: #{mail.diagnostic_code}\n Retryable?: #{mail.retryable}\nLOGGING\n\n puts send_error if @debug_logging_enabled\n @error_message = @error_message + send_error\n return { \"message_id\" => nil }\n end\n rescue Exception => e\n if @error_handling == \"Raise Error\"\n raise\n else\n send_error = \"#{e.class.name} : #{e}\"\n puts send_error if @debug_logging_enabled\n @error_message = @error_message + send_error\n return { \"message_id\" => nil }\n end\n end\n end", "def fetch_mail\n# \tp \"Fetching mail...\"\n \tconfig = { :host => 'imap.gmail.com', :port => 993, :username => 'CrowdAssistant', :password => 'CrowdAss'}\n \timap = Net::IMAP.new(config[:host], config[:port], true)\n \timap.login(config[:username], config[:password])\n \timap.select(\"INBOX\")\n \tmessages_to_archive = []\n \timap.search([\"NOT\", \"DELETED\"]).each do |message_id|\n \t\ttask = imap.fetch(message_id, 'BODY[TEXT]')[0].attr['BODY[TEXT]']\n \t\tmessage = imap.fetch(message_id, 'ENVELOPE')[0].attr['ENVELOPE']\n \t\tfrom = \"#{message.sender[0].mailbox}@#{message.sender[0].host}\"\n# p from\n \t\tu = User.find_by_email(from)\n# p u\n \t\tif u\n\t \t\t#Why does an empty resource and resourcetype fail?\n task = task.gsub(\"=\\r\\n\", \"\")\n\t \t\tt = Task.create(:user_id => u.id, :instructions => task, :fields => \"[{\\\"Reply\\\":\\\"t\\\"}]\", :priority => 2, :workflow => \"p\", :redundancy => 2, :resource => \"www.google.com\", :resourcetype => \"l\", :status=>\"Not Started\")\n\t \t\tAssistant.handle(t)\n\t \telse\n#\t \t\tp \"Whoops, some dude who hasn't signed up sent us an email\"\n\t \tend\n \t\tmessages_to_archive << message_id\n \tend\n \timap.store(messages_to_archive, \"+FLAGS\", [:Deleted]) unless messages_to_archive.empty?\n end", "def tick \n mailer.messages.each do |request| \n response = mailer.new_message(:to => request.from, \n :from => settings.service.default_sender)\n\n process_request(request, response) && response.deliver\n end\n rescue StandardError => e\n logger.fatal(\"SERVER ERROR\") { \"#{e.inspect}\\n\" + e.backtrace.join(\"\\n \") }\n raise\n end", "def execute\n space_slug = @parameters[\"space_slug\"].empty? ? @info_values[\"space_slug\"] : @parameters[\"space_slug\"]\n if @info_values['api_server'].include?(\"${space}\")\n @api_server = @info_values['api_server'].gsub(\"${space}\", space_slug)\n elsif !space_slug.to_s.empty?\n @api_server = @info_values['api_server']+\"/\"+space_slug\n else\n @api_server = @info_values['api_server']\n end\n\n # Build Recipient JSON Based on input value. If not JSON, assume it's an email address\n begin\n @recipient_json = JSON.parse(@parameters[\"recipient_json\"])\n rescue\n @recipient_json = { \"smtpaddress\" => @parameters[\"recipient_json\"], \"type\" => \"smtp\", \"email notifications\" => 'yes' }\n end\n\n # Build Up Template with snippet Replacements\n template_to_use = mergeTemplateAndsnippets(@template_name)\n\n # Get Valid Date formats from CE\n getDateFormats()\n\n # Replace Content in Subject, HTML Body, Text Body if a Template was found\n template_to_use[\"Subject\"] = apply_replacements(template_to_use[\"Subject\"])\n template_to_use[\"HTML Content\"] = apply_replacements(template_to_use[\"HTML Content\"])\n template_to_use[\"Text Content\"] = apply_replacements(template_to_use[\"Text Content\"])\n\n ################################################\n ## SEND EMAIL AND CREATE NOTIFICATION IN CE ##\n ################################################\n\n # Check to make sure a valid message template was found\n if !template_to_use.nil?\n\n # If the User has an email address and want to receive notifications\n email_results = {}\n if !@recipient_json[\"smtpaddress\"].to_s.empty? && @recipient_json[\"email notifications\"].to_s.downcase != 'no'\n email_results = sendEmailMessage(template_to_use)\n else\n @error_message = @error_message + \"\\nNo Email Address or CE User was provided\"\n end\n\n # Returning Results With Success\n results = \"<results>\\n\"\n results += \" <result name='Handler Error Message'>#{escape(@error_message)}</result>\\n\"\n results += \" <result name='Email Id'>#{escape(email_results['message_id'])}</result>\\n\"\n results += \"</results>\"\n else\n @error_message = \"Notification template \\\"#{@template_name}\\\" could not be found.\"\n # Returning Results With Failure\n results = \"<results>\\n\"\n results += \" <result name='Handler Error Message'>#{escape(@error_message)}</result>\\n\"\n results += \" <result name='Email Id'></result>\\n\"\n results += \"</results>\"\n end\n return results\n end", "def mail; get_data_in_file :mail end", "def run_and_email!(mailgun_url, target_emails)\n puts 'Running report...'\n report_text = run()\n puts 'Done.'\n puts\n puts 'Report output:'\n puts report_text\n puts\n\n puts 'Sending emails...'\n target_emails.each do |target_email|\n date_text = DateTime.now.beginning_of_day.strftime('%B %e, %Y')\n post_data = Net::HTTP.post_form(URI.parse(mailgun_url), {\n :from => \"Student Insights job <kevin.robinson.0@gmail.com>\",\n :to => target_email,\n :subject => \"Student Insights Usage Report for #{date_text}\",\n :html => \"<html><body><pre style='font: monospace; font-size: 12px;'>#{report_text}</pre>\"\n })\n puts \"to: #{target_email}\"\n puts \"code: #{post_data.code}\"\n puts \"body: #{post_data.body}\"\n puts\n end\n\n puts\n puts 'Done.'\n end", "def decode_workitem( email )\n ldebug { \"decoding workitem from: #{email}\" }\n analysis_error_response( email )\n arwi_id = get_arwi_id_for_decode( email )\n puts \"listener got arwi:#{arwi_id}\"\n return unless arwi_id && arwi_id.to_s.size > 0\n workitem = MailItem.get_workitem( arwi_id, 'delete', \"listener\" )\n puts \"listener can not got workitem for arwi:#{arwi_id}\" unless workitem\n return unless workitem\n puts \"listener got wi:#{workitem.class}, #{workitem}\"\n workitem[\"attachment\"] = email[:attachment]\n workitem[\"email_from\"] = email[:from].join(',')\n begin\n SMOperation.build( email, workitem )\n email[:subject] = Kconv.toutf8(email[:subject])\n # _ps_type = $1 if /\\+([a-z]+)?_?([\\d]+)@/ =~ email[:to]\n # step = SMSpreadsheet.get_stepname_from_spreadsheet( workitem.fei.wfname, _ps_type )\n event = Hash.new\n event[:title] = \"#{email[:subject]}\"\n event[:desc] = \"#{email[:body]}\"\n calendar_name = workitem.fields['user_name'] || 'default'\n SMGoogleCalendar.create_event( event, calendar_name )\n rescue Exception => e\n puts \"decode_workitem error: #{e.message}\"\n end\n print \"#{@blue_underline}3.listener processed workitem:#{@normal} #{workitem}\\n\"\n workitem\n end", "def submission\n if @job.status?\n @application = Application.new(application_params)\n email_api = Email_api.new\n if email_api.email(@application)\n render json: @application, status: :OK\n else\n render json: @application.errors, status: :bad_request\n end\n else\n render plain: job_not_active, status: :unprocessable_entity\n end\n end", "def email\n return unless can_be_emailed\n\n OfferMailer.email_contract(@offer).deliver_now!\n\n if @offer.provisional?\n # If the assignment has not been sent before, set status to pending\n @offer.pending!\n else\n # If the assignment has been sent before, make sure the emailed date gets updated.\n @offer.emailed_date = Time.zone.now\n @offer.save!\n end\n render_success @offer\n end", "def send_email\n subject = params['send_email']['subject']\n body = params['send_email']['email_body']\n participant_id = params['participant_id']\n assignment_id = params['assignment_id']\n @participant = AssignmentParticipant.find_by(id: participant_id)\n @team = Team.find_by(parent_id: assignment_id)\n\n mappings = review_mappings(assignment_id, @team.id)\n respond_to do |format|\n if subject.blank? || body.blank?\n flash[:error] = 'Please fill in the subject and the email content.'\n format.html { redirect_to controller: 'student_task', action: 'email_reviewers', id: @participant, assignment_id: assignment_id }\n format.json { head :no_content }\n else\n # make a call to method invoking the email process\n unless mappings.length.zero?\n mappings.each do |mapping|\n reviewer = mapping.reviewer.user\n MailerHelper.send_mail_to_author_reviewers(subject, body, reviewer.email)\n end\n end\n flash[:success] = 'Email sent to the reviewers.'\n format.html { redirect_to controller: 'student_task', action: 'list' }\n format.json { head :no_content }\n end\n end\n end", "def send_email(_invoice)\n code = '$ok'\n from = nil\n to = nil\n\n # Search offer & items\n @sale_offer = SaleOffer.find(_invoice)\n @items = @sale_offer.sale_offer_items.order(:id)\n\n title = t(\"activerecord.models.sale_offer.one\") + \"_\" + @sale_offer.full_no + \".pdf\"\n pdf = render_to_string(filename: \"#{title}\", type: 'application/pdf')\n from = !current_user.nil? ? User.find(current_user.id).email : User.find(@sale_offer.created_by).email\n to = !@sale_offer.client.email.blank? ? @sale_offer.client.email : nil\n\n if from.blank? || to.blank?\n code = \"$err\"\n else\n # Send e-mail\n Notifier.send_sale_offer(@sale_offer, from, to, title, pdf).deliver\n end\n\n code\n end", "def deliver!(mail)\n parameters = settings.dup\n parameters.delete(:return_response)\n message = MultiMail::Message::SendGrid.new(mail).to_sendgrid_hash.merge(parameters)\n\n connection = Faraday.new do |conn|\n conn.request :multipart\n conn.request :url_encoded\n conn.adapter Faraday.default_adapter\n end\n\n response = connection.post('https://sendgrid.com/api/mail.send.json', message)\n\n body = JSON.load(response.body)\n\n unless response.status == 200\n if body['message'] == 'error'\n case body['errors']\n when ['Bad username / password']\n raise InvalidAPIKey, body['errors'].first\n when ['Empty from email address (required)']\n raise MissingSender, body['errors'].first\n when ['Missing destination email']\n raise MissingRecipients, body['errors'].first\n when ['Missing subject']\n raise MissingSubject, body['errors'].first\n when ['Missing email body']\n raise MissingBody, body['errors'].first\n else\n raise body['errors'].join\n end\n else\n raise body['errors'].join\n end\n end\n\n if settings[:return_response]\n body\n else\n self\n end\n end", "def get_mail_attachment\n Log.add_info(request, params.inspect)\n\n attached_id = params[:id].to_i\n begin\n mail_attach = MailAttachment.find(attached_id)\n rescue => evar\n end\n\n if mail_attach.nil?\n redirect_to(THETIS_RELATIVE_URL_ROOT + '/404.html')\n return\n end\n\n begin\n email = Email.find(mail_attach.email_id)\n rescue => evar\n end\n if email.nil? or email.user_id != @login_user.id\n render(:text => '')\n return\n end\n\n mail_attach_name = mail_attach.name\n\n agent = request.env['HTTP_USER_AGENT']\n unless agent.nil?\n ie_ver = nil\n agent.scan(/\\sMSIE\\s?(\\d+)[.](\\d+)/){|m|\n ie_ver = m[0].to_i + (0.1 * m[1].to_i)\n }\n mail_attach_name = CGI::escape(mail_attach_name) unless ie_ver.nil?\n end\n\n filepath = mail_attach.get_path\n if FileTest.exist?(filepath)\n send_file(filepath, :filename => mail_attach_name, :stream => true, :disposition => 'attachment')\n else\n send_data('', :type => 'application/octet-stream;', :disposition => 'attachment;filename=\"'+mail_attach_name+'\"')\n end\n end", "def upload\n EmailsWorker.async_process_backup_email(:id => self.id)\n end", "def test_attachments_added\n Attachment.storage_path = TestHelper.files_path + '/files'\n issue = Issue.find(1)\n email = HelpdeskMailer.\n email_to_supportclient(\n issue,\n {:recipient => \"owner@example.com\",\n :journal => Journal.find(3),\n :text => 'text'\n }).deliver\n assert !ActionMailer::Base.deliveries.empty?\n mail = ActionMailer::Base.deliveries.last\n assert_not_nil mail\n attachments_length = mail.attachments.length\n assert_equal 1, attachments_length\n filename = mail.attachments[0].filename\n assert_equal \"source.rb\", filename\n content = mail.attachments[0].body.to_s\n original_content = File.open(\n Attachment.find(\n Journal.find(3).details.first.prop_key).diskfile).read\n assert_equal original_content, content\n end", "def deliver!(mail)\n message = MultiMail::Message::Mandrill.new(mail).to_mandrill_hash.merge(parameters)\n\n response = Faraday.post('https://mandrillapp.com/api/1.0/messages/send.json', JSON.dump({\n :key => api_key,\n :message => message,\n :async => async,\n :ip_pool => ip_pool,\n :send_at => send_at,\n }))\n\n body = JSON.load(response.body)\n\n unless response.status == 200\n if body['status'] == 'error'\n case body['name']\n when 'Invalid_Key'\n raise InvalidAPIKey, body['message']\n else\n raise body['message']\n end\n else\n raise body['message']\n end\n end\n\n if settings[:return_response]\n body\n else\n self\n end\n end", "def email_job_result(jlh)\n return unless email_result?(jlh)\n email_expression = Regexp.new('EMAIL_RESULT_BELOW:(.*)EMAIL_RESULT_ABOVE',Regexp::MULTILINE)\n match = email_expression.match(jlh[:job_result])\n jmd = jlh[:jmd]\n jle = jlh[:jle]\n if (match.nil?)\n $logger.debug(\"The output for job_code #{jmd.job_code} does not have valid e-mail output!\")\n return\n end\n $logger.debug(\"The output for job_code #{jmd.job_code} does have valid e-mail output! See the rails log for details\")\n body = match[1]\n #get the subject from the body\n match = Regexp.new('SUBJECT:(.*)').match(body)\n subject = match[1] unless match.nil?\n body.sub!(\"SUBJECT:#{subject}\",'')#append on subject\n subject = $application_properties['service_subject'] + \" \" + subject if jlh.has_key?(:service)\n subject = subject + ' -- REMINDER ' + @reminder_hash[jmd.job_code].to_s if (jlh[:reminder_email])\n body.chomp!.reverse!.chomp!.reverse! unless jmd.email_content_type.eql?('text/html')\n from = $application_properties['PST_Team']\n content_type = jmd.email_content_type\n recipients = []\n cc = []# or should it be ''?\n #banana slug\n #integrate with escalation levels to get additional e-mails out of the escalation\n recipients = jlh[:email_to] if jlh.has_key?(:email_to)\n cc = jlh[:email_cc] if jlh.has_key?(:email_cc)\n\n if (jmd.track_status_change && jmd.email_on_status_change_only)\n esc = jle.get_escalation\n esc = JobLogEntry.before(jle).status_not(\"UNKNOWN\").limit(1).first.get_escalation if esc.nil? #if this is nil this jle is green\n\n if ! esc.nil? #this is added in the event that the alert has never been red and we are in this method because we are executing as a service\n esc_emails = esc.get_escalation_based_emails\n recipients = recipients | esc_emails[0]\n cc = cc | esc_emails[1]\n end\n end\n\n recipients = recipients.uniq.join(',')\n cc = cc.uniq.join(',')\n\n email_hash = {:request => jmd.job_code, :content_type => content_type, :subject=>subject,\n :recipients=>recipients, :from=>from, :cc=>cc,:body=>body,\n :incl_attachment=>jmd.incl_attachment,:attachment_path=>jmd.attachment_path,\n :jmd => jmd, :jle => jle}\n\n JobMailer.job_result(email_hash).deliver\n end", "def deliver_mail\n @invitation.deliver_mail\n track 'Invitation Deliver Mail', @invitation\n redirect_to account_invitations_path, notice: 'Invitation email has been sent.'\n end", "def welcome_email\n attachments['filename.jpg'] = File.read('/path/to/filename.jpg')\n # ...\n end", "def process(event)\n debug do\n mailer = event.payload[:mailer]\n action = event.payload[:action]\n \"#{mailer}##{action}: processed outbound mail in #{event.duration.round(1)}ms\"\n end\n end", "def execute\n @imap = Net::IMAP.new(@imap_setting[:server], @imap_setting[:port])\n @imap.login(@imap_setting[:user], @imap_setting[:password])\n @imap.select(@imap_setting[:folder])\n \n #process all mail read email with test in subject for testing purpose. In reality it will process all emails\n query = imap_setting[:mode] == \"prod\" ? ['NOT', 'SEEN'] : ['SUBJECT', 'test']\n @imap.uid_search(query).each do |uid|\n catch(:continue) do\n mail = TMail::Mail.parse( imap.uid_fetch(uid, 'RFC822').first.attr['RFC822'] )\n from = mail.from\n to = mail.to\n bcc = mail.bcc\n cc = mail.cc\n subject = mail.subject\n msgid = mail.message_id \n date = mail.date\n ref_msgid = [mail.in_reply_to, mail.references].flatten.compact.join(\" \") \n \n #normalize all email addresses\n from.map! {|address| normalize_address(address) }\n to.map! {|address| normalize_address(address) }\n cc.map! {|address| normalize_address(address) } unless cc.is_nil?\n bcc.map! {|address| normalize_address(address) } unless bcc.is_nil?\n\n #find matching user\n user = nil\n user_email = from.find do |f|\n user = User.find_by_email(f.downcase)\n end\n \n if user\n logger.info \"processing email for #{user.username}\"\n if bcc.include?(@imap_setting[:email])\n #if from as user or asignee to as contact and we are in bcc it's outbound\n contacts = to.map do |t|\n #find contact by user or assigned to\n contact = Contact.find_by_email_and_user(t, user)\n if contact.nil?\n contact = Contact.find_by_email_and_assignee(t, user)\n end\n \n if contact.nil?\n #create contact, user is emailing a contact that's not in FFC\n logger.info \"new contact #{t}\"\n contact = Contact.new\n contact.user = user\n contact.email = t\n unless contact.save \n logger.warn \"could not save contact #{t}\"\n contact = nil\n end\n end\n contact\n end\n contacts.compact!\n \n #save mail\n from_list = from.join(\" \")\n to_list = to.join(\" \")\n cc_list = cc.join(\" \")\n bcc_list = bcc.join(\" \")\n body = mail.quoted_body\n save_email(from_list, to_list, subject, cc_list, bcc_list, body, msgid, ref_msgid, date, user, contacts)\n else\n #TODO if fowarded msg has from as user and to as contact it's inbound\n \n end\n \n else\n #unknown sender,this email is not supposed to be in drop box\n logger.warn \"mail from unknown user from: #{from} to: #{to} subject: #{subject}\"\n handle_processed_mail(uid) if @imap_setting[:mode] == \"prod\"\n end\n \n end\n \n end\n @imap.logout\n @imap.disconnect\n \n rescue Net::IMAP::NoResponseError => e\n logger.error \"IMAP server error\"\n rescue Net::IMAP::ByeResponseError => e\n logger.error \"IMAP server error\"\n rescue => e\n logger.error \"IMAP server error\"\n \n end", "def email\n @response, @documents = get_solr_response_for_field_values(SolrDocument.unique_key,params[:id])\n if request.post?\n if params[:to]\n url_gen_params = {:host => request.host_with_port, :protocol => request.protocol}\n\n flash[:error] = I18n.t('blacklight.email.user_not_signed_in') if !user_signed_in?\n\n if params[:to].match(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/)\n email = RecordMailer.email_record(@documents, {:to => params[:to], :message => params[:message]}, url_gen_params)\n else\n flash[:error] = I18n.t('blacklight.email.errors.to.invalid', :to => params[:to])\n end\n else\n flash[:error] = I18n.t('blacklight.email.errors.to.blank')\n end\n\n unless flash[:error]\n email.deliver\n flash[:success] = \"Email sent\"\n redirect_to catalog_path(params['id']) unless request.xhr?\n end\n end\n\n unless !request.xhr? && flash[:success]\n respond_to do |format|\n format.js { render :layout => false }\n format.html\n end\n end\n end", "def launch_email_client(event)\n mail_list = @@item.mail_list\n mail_list = \"private@#{mail_list}.apache.org\" unless mail_list.include? '@'\n\n to = @@item.chair_email\n cc = \"#{mail_list},#{@@item.cc}\"\n\n if @@item.missing\n subject = \"Missing #{@@item.title} Board Report\"\n if @@item.attach =~ /^\\d/\n body = %{\n Dear #{@@item.owner},\n\n The board report for #{@@item.title} has not yet been submitted for\n this month's board meeting. Please try to submit these reports by the\n Friday before the meeting.\n\n Thanks,\n\n #{User.username}\n }\n else\n body = %{\n Dear #{@@item.owner},\n\n The board report for #{@@item.title} has not yet been submitted for\n this month's board meeting. If you or another member of the PMC are\n unable to get it in by twenty-four hours before meeting time, please\n let the board know, and plan to report next month.\n\n https://www.apache.org/foundation/board/reporting#how\n\n Thanks,\n\n #{User.username}\n\n (on behalf of the ASF Board)\n }\n end\n\n # strip indentation; concatenate lines within a paragraph\n indent = body[/^\\s*/]\n body = body.strip().gsub(/#{indent}/, \"\\n\").gsub(/(\\S)\\n(\\S)/, \"$1 $2\")\n else\n subject = \"#{@@item.title} Board Report\"\n body = @@item.comments.join(\"\\n\\n\")\n\n if not body and @@item.text\n monthNames = %w(January February March April May June July August\n September October November December)\n year = Agenda.date.split('-')[0].to_i\n month = Agenda.date.split('-')[1].to_i\n\n subject = \"[REPORT] #{@@item.title} - #{monthNames[month-1]} #{year}\"\n to = @@item.cc\n cc = mail_list\n body = @@item.text\n end\n end\n\n if event.ctrlKey or event.shiftKey or event.metaKey\n @email = {\n to: to,\n cc: cc,\n subject: subject,\n body: body\n }\n\n jQuery('#email-' + @@item.mail_list).modal(:show)\n else\n window.location = \"mailto:#{to}?cc=#{cc}\" +\n \"&subject=#{encodeURIComponent(subject)}\" +\n \"&body=#{encodeURIComponent(body)}\"\n end\n end", "def seller_invoices\n logger.info(\"Will send email of SELLER JDE and ZLot csvs\")\n email = current_employee.present? ? current_employee.email : \"salesreports@outbid.com\"\n logger.info(\"Will send email to \\\"#{email}\\\"\")\n Vehicle.queue_seller_invoice_email(email)\n \n respond_to do |format|\n format.json { render json: { message: \"success\" } }\n format.html { redirect_to vehicles_url(:state_as_string => \"wtg_for_settlement_confirmation\") }\n end\n end", "def tick \n mailer.messages.each do |request| \n response = mailer.new_message(:to => request.from, \n :from => settings.service.default_sender)\n \n begin\n apps.each do |app|\n app.call(:request => request, \n :response => response, \n :settings => settings,\n :logger => logger)\n end\n rescue StandardError => e\n logger.info(\"FAIL\") { e.to_s }\n logger.debug(\"FAIL\") { \"#{e.inspect}\\n\"+e.backtrace.join(\"\\n \") }\n\n if settings.service.raise_exceptions\n raise\n else\n next\n end\n end\n\n response.deliver\n end\n rescue Exception => e\n logger.fatal(\"Caught exception: #{e}\\n\\n#{e.backtrace.join(\"\\n\")}\")\n raise\n end", "def mailer; end", "def process!(mail_package = nil)\n super_return_value = super\n if processed?\n AppellantNotification.appeal_mapper(appeal.id, appeal.class.to_s, \"decision_mailed\")\n case appeal_type\n when \"Appeal\"\n template = appeal.contested_claim? ? \"#{@@template_name} (Contested claims)\" : \"#{@@template_name} (Non-contested claims)\"\n AppellantNotification.notify_appellant(appeal, template)\n when \"LegacyAppeal\"\n template = appeal.contested_claim ? \"#{@@template_name} (Contested claims)\" : \"#{@@template_name} (Non-contested claims)\"\n AppellantNotification.notify_appellant(appeal, template)\n end\n end\n super_return_value\n end", "def receive(message)\n # For now just take the first attachment and assume there is only one\n attachment = message.attachments.first\n\n# logger.debug(message.subject)\n# logger.debug(message.attachments.count)\n\n # Create the micropost\n @email = message.from[0].to_s # first email address in 'from' array\n @user = User.find_by_email(@email)\t# find user by email\n\nputs \"***************************\"\nputs @email\n\n if @user != nil\nputs @user.email\n\n Micropost.create do |micropost|\n \n micropost.content = message.subject\n micropost.user_id = @user.id\n\n # Create an AttachmentFile subclass of a tempfile with paperclip aware features and add it\n image_file = AttachmentFile.new('test.jpg')\n image_file.write attachment.decoded.force_encoding(\"utf-8\")\n image_file.flush\n image_file.original_filename = attachment.filename\n image_file.content_type = attachment.mime_type\n micropost.image = image_file\n\tend\nputs \"***************************\"\n\n# UserMailer.registration_confirmation(user).deliver\n\n end\n end", "def get_attachments_for_display\n ensure_parts_counted\n\n main_part = get_main_body_text_part\n leaves = get_attachment_leaves\n attachments = []\n for leaf in leaves\n if leaf != main_part\n attachment = FOIAttachment.new\n\n attachment.body = leaf.body\n # As leaf.body causes MIME decoding which uses lots of RAM, do garbage collection here\n # to prevent excess memory use. XXX not really sure if this helps reduce\n # peak RAM use overall. Anyway, maybe there is something better to do than this.\n GC.start \n\n attachment.filename = _get_censored_part_file_name(leaf)\n if leaf.within_rfc822_attachment\n attachment.within_rfc822_subject = leaf.within_rfc822_attachment.subject\n\n # Test to see if we are in the first part of the attached\n # RFC822 message and it is text, if so add headers.\n # XXX should probably use hunting algorithm to find main text part, rather than\n # just expect it to be first. This will do for now though.\n # Example request that needs this:\n # http://www.whatdotheyknow.com/request/2923/response/7013/attach/2/Cycle%20Path%20Bank.txt\n if leaf.within_rfc822_attachment == leaf && leaf.content_type == 'text/plain'\n headers = \"\"\n for header in [ 'Date', 'Subject', 'From', 'To', 'Cc' ]\n if leaf.within_rfc822_attachment.header.include?(header.downcase)\n headers = headers + header + \": \" + leaf.within_rfc822_attachment.header[header.downcase].to_s + \"\\n\"\n end\n end\n # XXX call _convert_part_body_to_text here, but need to get charset somehow\n # e.g. http://www.whatdotheyknow.com/request/1593/response/3088/attach/4/Freedom%20of%20Information%20request%20-%20car%20oval%20sticker:%20Article%2020,%20Convention%20on%20Road%20Traffic%201949.txt\n attachment.body = headers + \"\\n\" + attachment.body\n\n # This is quick way of getting all headers, but instead we only add some a) to\n # make it more usable, b) as at least one authority accidentally leaked security\n # information into a header.\n #attachment.body = leaf.within_rfc822_attachment.port.to_s\n end\n end\n attachment.content_type = leaf.content_type\n attachment.url_part_number = leaf.url_part_number\n attachments += [attachment]\n end\n end\n\n uudecode_attachments = get_main_body_text_uudecode_attachments\n c = @count_first_uudecode_count\n for uudecode_attachment in uudecode_attachments\n c += 1\n uudecode_attachment.url_part_number = c\n attachments += [uudecode_attachment]\n end\n\n return attachments\n end", "def process_multipart_mail(mail, body, images_needing_replacement, keyvals)\n html_part = -1\n txt_part = -1\n\n #Figure out which part is html and which\n #is text\n mail.parts.each_with_index do |p, idx|\n if p.content_type.start_with?(\"text/html\")\n html_part = idx\n elsif p.content_type.start_with?(\"text/plain\")\n txt_part = idx\n end\n end\n\n mail.attachments.each do |attachment|\n #TODO: break this out into a separate method.\n if (attachment.content_type.start_with?(\"image/\"))\n attachment_filename = attachment.filename\n images_dir = @blog.images_dir_under_jekyll + (\"/%02d/%02d/%02d\" % [keyvals[:time].year, keyvals[:time].month, keyvals[:time].day])\n local_images_dir = \"#{@blog.jekyll_dir}/#{images_dir}\"\n FileUtils.mkdir_p(local_images_dir)\n puts \"local_images_dir: #{local_images_dir}\"\n images_needing_replacement[attachment_filename] = \"/#{images_dir}/#{attachment_filename}\"\n puts \"image url: #{images_needing_replacement[attachment_filename]}\"\n begin\n local_filename = \"#{@blog.jekyll_dir}/#{images_dir}/#{attachment_filename}\"\n @logger.log(\"saving image to #{local_filename}\")\n unless File.writable?(local_images_dir)\n $stderr.puts(\"ERROR: #{local_images_dir} is unwritable. Exiting.\")\n end\n File.open(local_filename, \"w+b\", 0644) { |f| f.write attachment.body.decoded }\n # @files_to_commit << \"#{images_dir}/#{attachment_filename}\"\n @files_to_commit << local_filename\n rescue Exception => e\n $stderr.puts \"Unable to save data for #{attachment_filename} because #{e.message}\"\n end\n end\n end\n\n #If the markup isn't html, try and use the\n #text if it exists. Anything else, use the html\n #version\n if txt_part > -1 and keyvals[:markup] != \"html\"\n body = mail.parts[txt_part].body.decoded\n elsif html_part > -1\n body = mail.parts[html_part].body.decoded\n end\n body\n end", "def emailResults()\n obj = EmailHelper.new()\n emailSubject = \"Illumina Capture Stats : Flowcell \" + @fcBarcode.to_s\n emailFrom = \"sol-pipe@bcm.edu\" \n emailText = @captureResults.formatForSTDOUT()\n emailTo = obj.getCaptureResultRecepientEmailList()\n\n begin\n obj.sendEmail(emailFrom, emailTo, emailSubject, emailText)\n rescue Exception => e\n puts e.message \n puts e.backtrace.inspect\n end\n end", "def attachments\n process_message_body if !@attachments\n @attachments\n end", "def process_response\n job = message.job\n job.data = message.data\n job.message = message.message\n\n if message.ok?\n job.proceed!\n else\n job.error!\n end\n end", "def mail; end", "def upload_email(document_upload_email)\n consumer = document_upload_email.consumer\n @standard_document = document_upload_email.standard_document\n\n from_address = email_address_for(:notification)\n reply_to = document_upload_email.email\n consumer_email = document_upload_email.consumer_email\n subject = [\"Upload document\", @standard_document.name].join(\" - \")\n\n delivery_options = { user_name: ENV['SES_SMTP_USERNAME'],\n password: ENV['SES_SMTP_PASSWORD'],\n address: ENV['SES_SMTP_ADDRESS'] }\n\n @logo_asset_url = get_logo_asset_url\n\n mail(from: from_address, reply_to: reply_to, to: consumer_email, subject: subject, delivery_method_options: delivery_options) do |format|\n format.html\n end\n end", "def perform\n r = validate_and_sanitize\n return r unless r.success?\n\n create_email_service_api_call_hook\n\n success\n end", "def send_test\n email = Email.find(params[:id])\n @templet = email\n \n if request.post?\n begin\n recip = Recipient.new\n recip.email = params[:recipient][:email]\n \n Notifier::deliver_status_notify(:project => @project, :recipient => recip, :email => email)\n \n flash[:notice] = \"Test e-mail sent successfully!\"\n redirect_to :action => 'index'\n rescue\n flash.now[:error] = \"Unable to send the test email! \" + $!\n end\n end\n end" ]
[ "0.6445737", "0.62992346", "0.62779707", "0.6247057", "0.6162328", "0.6014607", "0.6004042", "0.5993383", "0.5950224", "0.59502155", "0.5886799", "0.5832686", "0.58004117", "0.5765758", "0.5738035", "0.5697251", "0.5692308", "0.5687707", "0.5686721", "0.567369", "0.56539917", "0.56499416", "0.56404966", "0.5626446", "0.5602719", "0.5592645", "0.5568587", "0.556333", "0.5549441", "0.55493283", "0.5541906", "0.55390215", "0.552682", "0.5523676", "0.5511677", "0.5504432", "0.5501258", "0.5496627", "0.54811895", "0.5454701", "0.5452971", "0.54521465", "0.54512966", "0.54423404", "0.5434995", "0.54287004", "0.5428238", "0.54240316", "0.5423095", "0.54208124", "0.5418172", "0.54166645", "0.5407291", "0.5406428", "0.540596", "0.5387677", "0.53844196", "0.5381543", "0.5373702", "0.5372585", "0.5372488", "0.53661", "0.5355887", "0.5355664", "0.53414685", "0.5339807", "0.5333198", "0.53298914", "0.5308451", "0.5303279", "0.5302558", "0.5300997", "0.5292255", "0.528362", "0.52782863", "0.527801", "0.5262945", "0.5262144", "0.52613497", "0.52527314", "0.5252508", "0.52496195", "0.5247133", "0.5247082", "0.5245647", "0.52431864", "0.52254367", "0.52167463", "0.520689", "0.52053034", "0.51970893", "0.5194384", "0.51896274", "0.51847386", "0.51797575", "0.5175994", "0.51739657", "0.5171485", "0.516677", "0.51629144" ]
0.6434325
1
Forward the email to sender, with decoded documents replacing the originals
def deliver_onward email, documents, mail_to logger.info "Sending response mail to #{mail_to}" email.cc [] # No CCing, just send to the recipient email.to mail_to email.subject "#{'Fwd: ' unless email.subject.to_s.start_with? 'Fwd:'}#{email.subject}" email.return_path email.from unless email.return_path # something weird goes on with Sharepoint, where the doc is dropped on the floor # so, remove any offending headers email.message_id = nil # make sure of message_id too good_headers = ONWARD_HEADERS.map{ |h| h.downcase } inspect_headers = email.header.map(&:name) inspect_headers .each do |name| unless good_headers.include? name.downcase email.header[name] = nil end end email.received = nil # make sure of received # replace attachments with converted files email.parts.delete_if { |p| p.attachment? } documents.each do |doc| if doc[:content] email.add_file filename: doc[:filename], content: doc[:content] else # preserve non-converted attachments when forwarding email.add_file filename: doc[:orig_filename], content: doc[:orig_content] end end email.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port] deliver email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deliver_rts email, documents, mail_to\n logger.info \"Sending response mail to #{mail_to}\"\n mail = Mail.new\n mail.from @cfg[:from]\n mail.to mail_to\n # CCs to the original email will get a copy of the converted files as well\n mail.cc (email.cc - email.to - (@cfg[:cc_blacklist]||[]) ) if email.cc # Prevent autoheathen infinite loop!\n # Don't prepend yet another Re:\n mail.subject \"#{'Re: ' unless email.subject.start_with? 'Re:'}#{email.subject}\"\n # Construct received path\n # TODO: is this in the right order?\n #rcv = \"by localhost(autoheathen); #{Time.now.strftime '%a, %d %b %Y %T %z'}\"\n #[email.received,rcv].flatten.each { |rec| mail.received rec.to_s }\n mail.return_path email.return_path if email.return_path\n mail.header['X-Received'] = email.header['X-Received'] if email.header['X-Received']\n documents.each do |doc|\n next if doc[:content].nil?\n mail.add_file filename: doc[:filename], content: doc[:content]\n end\n cfg = @cfg # stoopid Mail scoping\n me = self # stoopid Mail scoping\n mail.text_part do\n s = Haml::Engine.new( me.read_file cfg[:text_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.html_part do\n content_type 'text/html; charset=UTF-8'\n s = Haml::Engine.new( me.read_file cfg[:html_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg)\n body s\n end\n mail.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port]\n deliver mail\n end", "def forward\n message = self.message.class.new(:subject => subject, :body => body)\n message.sender = receiver\n message\n end", "def forward\n message = self.class.new(:subject => subject, :body => body)\n message.sender = sender\n message\n end", "def forward_message(params={})\n response.from = request.from\n response.reply_to = settings.service.default_sender \n response.subject = request.subject\n\n params.each do |k,v|\n response.send(\"#{k}=\", v)\n end\n\n if request.multipart?\n response.text_part = request.text_part\n response.html_part = request.html_part\n else\n response.body = request.body.to_s\n end\n end", "def convert_email filename, in_dir, out_dir, language\n email = Mail.read( File.extname(filename)=='.msg' ? convert_msg(filename, in_dir, out_dir) : filename )\n f_base = filename.gsub /#{File.extname(filename)}$/, ''\n logger.debug \" email file, has #{email.attachments.size} attachments\"\n new_attachments = []\n converter = AutoHeathen::Converter.new( { logger: logger } )\n email.attachments.each do |attachment|\n content = attachment.decoded\n action = converter.get_action content.content_type\n logger.debug \" convert: #{File.basename(filename)}, content_type: #{content.content_type}, action: #{action}\"\n start_time = Time.now\n outfile, data = converter.convert action, language, attachment.filename, content\n logger.debug \" conversion took %0.2f s\"%[Time.now-start_time]\n new_attachments << { filename: File.basename(outfile), data: data }\n end\n email.charset = 'UTF-8' unless email.charset # stop annoying warning message if charset not defined in email\n # Mail#without_attachments! does not work correctly\n #email.without_attachments!\n email.parts.delete_if { |p| p.attachment? }\n new_attachments.each do |na|\n email.attachments[na[:filename]] = na[:data]\n end\n e_filename = to_outfile in_dir, filename, out_dir, \"#{f_base}.eml\"\n logger.debug \" writing #{e_filename} with #{email.attachments.size} converted attachments\"\n File.open( e_filename, 'w' ) do |f|\n f.write email.to_s\n end\nend", "def forward_as_attachment_to\n return @forward_as_attachment_to\n end", "def process email, mail_to, is_rts=false\n documents = []\n\n unless email.has_attachments?\n logger.info \"From: #{email.from} Subject: (#{email.subject}) Files: no attachments\"\n return\n end\n\n logger.info \"From: #{email.from} Subject: (#{email.subject}) Files: #{email.attachments.map(&:filename).join(',')}\"\n\n #\n # Convert the attachments\n #\n email.attachments.each do |attachment|\n begin\n converter = AutoHeathen::Converter.new( { logger: logger } )\n input_source = attachment.body.decoded\n action = converter.get_action input_source.content_type\n logger.info \" convert #{attachment.filename} using action: #{action}\"\n converted_filename, data = converter.convert action, @cfg[:language], attachment.filename, input_source\n documents << { orig_filename: attachment.filename, orig_content: input_source, filename: converted_filename, content: data, error: false }\n rescue StandardError => e\n documents << { orig_filename: attachment.filename, orig_content: input_source, filename: nil, content: nil, error: e.message }\n end\n end\n\n #\n # deliver the results\n #\n if is_rts\n deliver_rts email, documents, mail_to\n else\n deliver_onward email, documents, mail_to\n end\n\n #\n # Summarise the processing\n #\n logger.info \"Results of conversion\"\n documents.each do |doc|\n if doc[:content].nil?\n logger.info \" #{doc[:orig_filename]} was not converted (#{doc[:error]}) \"\n else\n logger.info \" #{doc[:orig_filename]} was converted successfully\"\n end\n end\n\n documents\n end", "def receive(email)\n post = Post.new\n\n # Will fail if no matches. Rely on validation\n list_post_header = email.header_string(\"List-Post\")\n matches = list_post_header.match(/<mailto:(\\S+)@/) if list_post_header\n if matches\n mailing_list_name = matches[1]\n else\n mailing_list_name = email.to.first.to_s\n end\n post.mailing_list = MailingList.find_by_name(mailing_list_name)\n\n post.subject = email.subject\n \n if email.multipart?\n plain_text_part = nil\n\n # Outlook\n related_part = email.parts.find { |part| \n part.content_type == \"multipart/related\"\n }\n if related_part\n alt_part = related_part.parts.find { |part| \n part.content_type == \"multipart/alternative\"\n }\n else\n alt_part = email.parts.find { |part| \n part.content_type == \"multipart/alternative\"\n }\n end\n \n # OS X rich text email\n if alt_part \n plain_text_part = alt_part.parts.find { |part| \n part.content_type == \"text/plain\"\n }\n end\n\n plain_text_part = email.parts.find { |part| \n part.content_type == \"text/plain\"\n } unless plain_text_part\n \n plain_text_part = email.parts.find { |part| \n part.content_type == \"text/html\"\n } unless plain_text_part\n \n post.body = plain_text_part.body\n end\n \n if post.body.blank?\n post.body = email.body\n end\n \n post.from_name = email.friendly_from\n post.from_email_address = email.from\n post.date = email.date\n begin\n post.save!\n rescue => save_error\n RACING_ON_RAILS_DEFAULT_LOGGER.error(\"Could not save post: #{save_error}\")\n if post and !post.errors.empty?\n RACING_ON_RAILS_DEFAULT_LOGGER.error(post.errors.full_messages)\n end\n raise\n end\n end", "def apply!(mail)\n mail.subject = redact(mail.subject)\n\n if mail.multipart?\n mail.parts.each do |part|\n part.body = redact(part.body)\n end\n else\n mail.body = redact(mail.body)\n end\n end", "def reply(fields)\n mail = Mail.new\n\n # fill in the from address\n mail.from = fields[:from]\n\n # fill in the reply to headers\n mail.in_reply_to = self.id\n mail.references = self.id\n\n # fill in the subject from the original email\n if self.subject =~ /^re:\\s/i\n mail.subject = self.subject\n elsif self.subject\n mail.subject = 'Re: ' + self.subject\n elsif fields[:subject]\n mail.subject = fields[:subject]\n end\n\n # fill in the subject from the original email\n mail.body = fields[:body]\n\n # gather up the to, cc, and bcc addresses\n to = []\n cc = []\n bcc = []\n\n # process 'bcc' addresses on method call\n # Do this first so can suppress such addresses in To: and Cc: fields\n if fields[:bcc]\n Array(fields[:bcc]).compact.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if bcc.any? {|a| a.address == addr.address}\n bcc << addr\n end\n end\n\n # process 'to' addresses on method call\n if fields[:to]\n Array(fields[:to]).compact.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if to.any? {|a| a.address = addr.address}\n to << addr\n end\n end\n\n # process 'from' addresses from original email\n self.from.addrs.each do |addr|\n next if to.any? {|a| a.address == addr.address}\n if fields[:to]\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n else\n to << addr\n end\n end\n\n # process 'to' addresses from original email\n if self.to\n self.to.addrs.each do |addr|\n next if to.any? {|a| a.address == addr.address}\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n end\n end\n\n # process 'cc' addresses from original email\n if self.cc\n self.cc.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if to.any? {|a| a.address == addr.address}\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n end\n end\n\n # process 'cc' addresses on method call\n if fields[:cc]\n Array(fields[:cc]).compact.each do |addr|\n addr = Message.liberal_email_parser(addr) if addr.is_a? String\n next if to.any? {|a| a.address == addr.address}\n next if cc.any? {|a| a.address == addr.address}\n next if bcc.any? {|a| a.address == addr.address} # skip if already in Bcc\n cc << addr\n end\n end\n\n # reformat email addresses\n mail[:to] = to.map(&:format)\n mail[:cc] = cc.map(&:format) unless cc.empty?\n mail[:bcc] = bcc.map(&:format) unless bcc.empty?\n\n # return the resulting email\n mail\n end", "def update\n @message.require_recipient = true\n respond_to do |format|\n if @message.update(message_params)\n recipient_user_id = @message.recipient_user_id\n forward_note = @message.fwd_note\n forward_note = t('messages.default_forward_note') if ((forward_note.nil?) || (forward_note == '')) # \"Forwarded message\"\n new_message = @message.dup\n if new_message.save\n new_message.update_attributes(owner_user_id: recipient_user_id,\n forwarded_message_id: @message.id,\n read: false,\n forward_note: forward_note,\n copied_message_id: @message.id)\n new_message.recipient_users.create(user_id: recipient_user_id)\n end\n if session[:messaging_context] == :index\n format.html { redirect_to messages_path, notice: t('messages.update') } # \"Message was successfully forwarded.\"\n format.json { head :no_content }\n elsif session[:messaging_context] == :mailbox_out\n format.html { redirect_to mailbox_out_messages_path, notice: t('messages.update') } # \"Message was successfully forwarded.\"\n format.json { head :no_content }\n else\n format.html { redirect_to mailbox_in_messages_path, notice: t('messages.update') } # \"Message was successfully forwarded.\"\n format.json { head :no_content }\n end\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end", "def transliterate_email\n self.email = email.transliterate\n end", "def ingest_email_message(to_save, uploader, skip_validations, obj, parent = nil)\n \n email_message = EmailMessage.ingest(uploader, obj)\n return nil if email_message.blank?\n\n email_message.is_ciscp = true if parent.present? && parent.is_ciscp\n email_message.is_mifr = true if parent.present? && parent.is_mifr\n parsed_embedded_objs = {\n from: [],\n reply_to: [],\n sender: [],\n x_originating_ip: []\n }\n parsed_embedded_objs.keys.each do |key|\n embedded_obj = obj.send(key)\n if embedded_obj.present?\n parsed_obj = self.parse_sub_obj(to_save, uploader, skip_validations, embedded_obj, email_message)\n next if parsed_obj.blank?\n parsed_embedded_objs[key] << parsed_obj\n end\n end\n email_message.from_address = parsed_embedded_objs[:from][0] if parsed_embedded_objs[:from][0].present?\n email_message.sender_address = parsed_embedded_objs[:sender][0] if parsed_embedded_objs[:sender][0].present?\n email_message.reply_to_address = parsed_embedded_objs[:reply_to][0] if parsed_embedded_objs[:reply_to][0].present?\n email_message.x_ip_address = parsed_embedded_objs[:x_originating_ip][0] if parsed_embedded_objs[:x_originating_ip][0].present?\n email_message\n end", "def update_email_forward(source, destination)\n validate_list([[\"Source\", source, :email],\n [\"Destination\", destination, :email]\n ])\n\n options = {\n \"Source\" => source,\n \"Destination\" => destination\n }\n\n connection = Connection.new\n connection.post(\"Domain/EmailForward/Update\", options)\n end", "def process_mail_from sender\n if @state.include? :mail_from\n @state -= [:mail_from, :rcpt, :data]\n receive_reset\n end\n\n super\n end", "def forward_message(message, forward_hash)\n get edit_message_path(message)\n assert_response :success\n assert_template \"edit\"\n patch message_path, message: forward_hash\n original_message = assigns(:message) # message being forwarded\n new_message = original_message.copies.first # message created by forward\n assert new_message.valid?\n assert_response :redirect\n assert_redirected_to mailbox_in_messages_path\n follow_redirect!\n assert_response :success\n assert_template \"mailbox_in\"\n return new_message\n end", "def convert_message(msg)\n\n $stderr.puts \"%sConverting message:\\n%s\" % \n [ $indent, msg.header.to_s.gsub(/^/, $indent+' ') ] if $DEBUG\n\n # Text/plain messages are subject to conversion\n case msg.header.content_type\n when nil, %r{^text/plain}, %r{^message/rfc822}\n $stderr.puts \"%sThis is a text/plain message\" % [ $indent ] if $DEBUG\n\n # Start by doing PGP ... if this matches then we don't want to\n # mess with uuencoded stuff because that would break the signature\n nmsg = convert_pgp(msg)\n nmsg = convert_uu(msg) unless nmsg\n msg = nmsg if nmsg\n end\n\n # Multi-part messages are converted part by part, depth-first.\n # Note this could be acting on a converted text/plain message from\n # above, which is good, because it means we'll fix the\n # Content-Length and Lines headers (as well as convert embedded\n # message, but what are the chances of that?)\n if msg.multipart?\n\n # Convert each part\n unless msg.header.content_type =~ %r{^multipart/signed}\n # Create the new message. Start by duplicating the headers. \n nmsg = RMail::Message.new\n nmsg.header.replace(msg.header.dup)\n nmsg.preamble, nmsg.epilogue = msg.preamble, msg.epilogue\n\n $indent << ' ' # for $DEBUG\n msg.each_part { |part| nmsg.add_part(convert_message(part)) }\n $indent[0,2] = '' # for $DEBUG\n\n # This is now the message\n msg = nmsg\n end\n\n # Add length headers; requires serializing at this point\n s = msg.to_s # this is the full serialized message\n h = msg.header.to_s\n content_length = s.length - h.length - 1\n if content_length > 0\n msg.header.set('Content-Length', content_length.to_s)\n lines = s.count(\"\\n\") - h.count(\"\\n\") - 1\n msg.header.set('Lines', lines.to_s)\n end\n end\n\n return msg\nend", "def process_message_body\n @attachments = []\n if @mail.multipart?\n @body, @html = [], []\n scan_parts(@mail)\n @body = @body.join(\"\\n\")\n @html = @html.join(\"\\n\")\n else\n if @mail.content_type =~ /text\\/html/\n @html = @mail.body.to_s\n @body = ''\n else\n @body = @mail.body.to_s\n @html = ''\n end\n end\n\n @body = convert_to_utf8(@body)\n @html = convert_to_utf8(@html)\n end", "def decode_of_mail( em, type_str = \"subject\")\n if type_str == \"subject\" || type_str == \"sender_rec_name\"\n return nil if type_str == \"sender_rec_name\" && em.from[0].name.blank?\n\n match_str = /(=\\?[a-zA-Z0-9\\-]+)(\\?[B|Q]\\?)([a-zA-Z-0-9\\/=]+)/\n em.subject.scan(match_str) if type_str == \"subject\"\n em.from[0].name.scan(match_str) if type_str == \"sender_rec_name\"\n\n # TODO: implementing Q decode\n return Base64.decode64($3).force_encoding($1.gsub(/=\\?/,\"\")).encode(\"utf-8\") unless $1.blank?\n if $1.blank?\n return em.subject if type_str == \"subject\"\n return em.from[0].name if type_str == \"sender_rec_name\"\n end\n\n else\n unless em.text_part.blank?\n body_of_mail = em.text_part.body\n if body_of_mail.encoding == \"base64\"\n ch_set = em.text_part.charset\n encoded_str = body_of_mail.encoded.gsub(/\\r\\n/,\"\")\n return Base64.decode64(encoded_str).force_encoding(ch_set).encode(\"utf-8\").gsub(/\\r\\n/,\"\")\n else\n return body_of_mail.encoded.to_s\n # return em.parts[1].body\n end\n end\n end\n end", "def read_mail(raw_mail_path)\n mail = Mail.read(raw_mail_path)\n postmarkish = {\n \"Date\" => mail.date.to_s.tap { |x| p [:date, x] },\n \"Subject\" => mail.subject,\n \"HtmlBody\" => mail.html_part.body.decoded,\n }\n F2fIncoming::PostmarkMail.new(postmarkish)\nend", "def process\n parsed = {}\n parsed[:contents] = \"#{@email.subject} ::: #{@email.body}\"\n parsed[:from] = \"#{@email.from[:email]}\"\n #[:to] is an array of hashes, since possible multiple to's\n parsed[:to] = \"#{@email.to[0][:email]}\"\n\n email_of_interest = parsed[:to]\n if !(/@/.match(parsed[:to]))\n Rails.logger.warn \"Poorly formatted email! parsed: #{parsed}\"\n end\n\n object = Person.react_to_email(email_of_interest)\n if object.class.to_s == \"Person\"\n Communication.create(person_id: object.id,\n contents: parsed[:contents],\n medium: \"email\",\n when: Date.today)\n end\n end", "def replace_and_send_mail_safely(mail, recipient)\n html_body = mail.html_part.body.raw_source\n do_custom_replacements_for(mail, recipient)\n send_raw_email_safely(mail)\n mail.html_part.body = html_body\n end", "def receive_inbound_email_from_mail(**kwargs, &block); end", "def convert_uu(msg)\n nmsg = nil\n\n nbody = msg.decode.gsub(UU_RE) { |s|\n filename, data = $1, $2.unpack('u')\n\n $stderr.puts \"%sFound a uuencoded section!\\n\" % [ $indent ] if $DEBUG\n\n unless nmsg\n # Now that we know there's a uuencoded section, build up a\n # multipart message\n nmsg = RMail::Message.new\n nmsg.header.replace(msg.header.dup)\n nmsg.header.delete('Content-Transfer-Encoding')\n nmsg.header.delete('Content-Length')\n nmsg.header.delete('Lines')\n nmsg.header.set('Content-Type', 'multipart/mixed', \n 'boundary' => '=-=-=-=-uu2mime-boundary-'+nmsg.object_id.to_s)\n nmsg.header.set('Content-Disposition', 'inline')\n nmsg.preamble = \"This is a multipart message converted by uu2mime\\n\"\n nmsg.epilogue = ''\n\n # This will eventually be the text/plain portion\n nmsg.add_part(RMail::Message.new)\n end\n\n # Convert this uuencoded section to an attachment\n npart = RMail::Message.new\n npart.header.set('Content-Type', 'application/octet-stream')\n npart.header.set('Content-Disposition', 'attachment', \n 'filename' => filename)\n npart.header.set('Content-Transfer-Encoding', 'base64')\n npart.body = data.pack('m')\n nmsg.add_part(npart)\n\n # Replace the uuencoded section with a note\n '[-- uu2mime snipped ' + filename + ' --]'\n }\n\n if nmsg\n # Tack the text/plain portion on the front.\n # Remove the old Content-Transfer-Encoding header since we've\n # decoded the section (is this the best?)\n nmsg.part(0).header.set('Content-Type', 'text/plain',\n 'charset' => 'us-ascii')\n nmsg.part(0).header.set('Content-Disposition', 'inline')\n nmsg.part(0).body = nbody\n end\n\n return nmsg\nend", "def process_email(email, subscriber)\n recipients = list.recipients(subscriber)\n process_message messages.build(\n :mail_list => self,\n :subscriber => subscriber,\n :recipients => recipients,\n :email => email\n ), :copy_sender => list.copy_sender?(subscriber)\n end", "def deliver!(mail)\n attributes = email_attributes(mail)\n mail.destinations.each do |destination|\n ArMailerRevised.email_class.create!(attributes.merge({:to => destination}))\n end\n end", "def preview_to(recipient)\n @newsletter = build_newsletter\n mail = build_mail\n mail.to = recipient.email\n replace_and_send_mail_safely(mail, recipient)\n end", "def transform(params)\n case @http_post_format\n when 'parsed', '', nil\n # Mail changes `self`.\n headers = self.class.multimap(JSON.load(params['message-headers']))\n this = self\n\n message = Message::Mailgun.new do\n headers headers\n\n # The following are redundant with `body-mime` in raw MIME format\n # and with `message-headers` in fully parsed format.\n #\n # from params['from']\n # sender params['sender']\n # to params['recipient']\n # subject params['subject']\n #\n # Mailgun POSTs all MIME headers both individually and in\n # `message-headers`.\n\n text_part do\n body params['body-plain']\n end\n\n if params.key?('body-html')\n html_part do\n content_type 'text/html; charset=UTF-8'\n body params['body-html']\n end\n end\n\n if params.key?('attachment-count')\n 1.upto(params['attachment-count'].to_i) do |n|\n attachment = params[\"attachment-#{n}\"]\n add_file(this.class.add_file_arguments(attachment))\n end\n end\n end\n\n # Extra Mailgun parameters.\n if params.key?('stripped-text') && !params['stripped-text'].empty?\n message.stripped_text = params['stripped-text']\n end\n if params.key?('stripped-signature') && !params['stripped-signature'].empty?\n message.stripped_signature = params['stripped-signature']\n end\n if params.key?('stripped-html') && !params['stripped-html'].empty?\n message.stripped_html = params['stripped-html']\n end\n if params.key?('content-id-map') && !params['content-id-map'].empty?\n message.content_id_map = params['content-id-map']\n end\n\n # @todo Store non-plain, non-HTML body parts.\n # params.keys.select do |key|\n # key[/\\Abody-(?!html|plain)/]\n # end\n\n [message]\n when 'raw'\n message = self.class.condense(Message::Mailgun.new(Mail.new(params['body-mime'])))\n [message]\n else\n raise ArgumentError, \"Can't handle Mailgun #{@http_post_format} HTTP POST format\"\n end\n end", "def my_alter_email_body!(mail, string)\n return my_alter_multipart_email!(mail, string) if mail.multipart?\n \n current_body = mail.body\n mail.body = current_body.to_s + \"\\n#{string}\"\n end", "def mail\n if @mail.nil? && !self.raw_email.nil?\n # Hack round bug in TMail's MIME decoding. Example request which provokes it:\n # http://www.whatdotheyknow.com/request/reviews_of_unduly_lenient_senten#incoming-4830\n # Report of TMail bug:\n # http://rubyforge.org/tracker/index.php?func=detail&aid=21810&group_id=4512&atid=17370\n copy_of_raw_data = self.raw_email.data.gsub(/; boundary=\\s+\"/ims,'; boundary=\"') \n\n @mail = TMail::Mail.parse(copy_of_raw_data)\n @mail.base64_decode\n end\n @mail\n end", "def forward_as_attachment_to=(value)\n @forward_as_attachment_to = value\n end", "def send_forward_meta_messages(*args); end", "def extract_and_save(message)\n tmail = extract_email(message.raw, is_journal_account)\n \n #skip messages that failed during parse\n if tmail && tmail.message_id && !tmail.message_id.strip.empty?\n # strip the mail body if we're only sending header data,\n # then convert to json format and save to file\n fname = tmail.message_id.strip.gsub(/[^\\w]/,'')\n rfc822_content = headers_only ? extract_header(tmail.to_s) : tmail.to_s\n json_content = mail_to_json(rfc822_content, Time.now)\n filestore.write(:complete, \"#{fname}\", json_content)\n end\n tmail\n end", "def persist_email(mail)\n mail.from.each do |sender|\n (mail.to || [\"\"]).each do |recipient|\n @factory.create!(\n :from => sender,\n :to => recipient,\n :subject => mail.subject,\n :content => mail.encoded,\n :bcc => get_bcc(mail)\n )\n end\n end\n end", "def to_mail( str )\n\tstr.dup\nend", "def deliver(reply = false, should_clean = true)\n self.clean if should_clean\n\n #Receiver receipts\n receiver_receipts = recipients.map do |r|\n receipts.build(receiver: r, mailbox_type: 'inbox', is_read: false)\n end\n\n #Sender receipt\n sender_receipt =\n receipts.build(receiver: sender, mailbox_type: 'sentbox', is_read: true)\n\n if valid?\n save!\n Mailboxer::MailDispatcher.new(self, receiver_receipts).call\n\n conversation.touch if reply\n\n self.recipients = nil\n\n on_deliver_callback.call(self) if on_deliver_callback\n end\n sender_receipt\n end", "def deliver!(mail)\n # construct message object with text and html parts\n message = {\n subject: mail.subject,\n from_email: mail.from.first,\n from_name: mail[:from].display_names.first,\n to: [\n {\n email: mail.to.first,\n name: mail[:to].display_names.first\n }\n ],\n text: mail.text_part.body.raw_source,\n html: mail.html_part.body.raw_source\n }\n\n # send via mandrill API\n Rails.configuration.mandrill_mailer.messages.send(message)\n end", "def correspond\n @user = current_user\n @recipient = User.find(params[:id])\n @title = \"Email #{@recipient.name}\"\n if param_posted?(:original) #if user is responding to an original mail \n # @original and @original_subject will be availabe in the correspond view\n @original_title = session[:original_title]\n @original_body = session[:original_subject]\n end\n\n @message ||= Message.new({:subject=>\"\", :body=>\"\"})\n\n if param_posted?(:message)\n #if @message.update_attributes(params[:message])\n @message.subject = params[:message][:subject]\n @message.body = params[:message][:body]\n\n if @message.valid?\n #@body_sesson and @title_session will be available to mailer and it's correspond_message view\n @body_session = session[:original_message] #creating session in the controller \n @title_session = session[:original_title]\n #passing message params including session instances to be accessible in action mailer\n UserMailer.correspond_mail(@user, @recipient, @message, \n @body_session, @title_session).deliver\n flash[:success] = \"Email sent to #{@recipient.name}\"\n redirect_to profile_path(@recipient)\n end\n end\n\n end", "def anonymize\n raw_message = File.read(@path)\n\n replace_with_xs = lambda { |text|\n raw_message.gsub!(text.to_s) { |match| 'X' * match.length }\n }\n\n # redact the Delivered-To field\n replace_with_xs[@message[:delivered_to]]\n\n # redact the addresses in the To field\n @message[:to].addresses.each(&replace_with_xs)\n\n # redact the display names in the To field\n @message[:to].display_names.compact.each(&replace_with_xs)\n \n return raw_message\n end", "def decode_workitem( email )\n ldebug { \"decoding workitem from: #{email}\" }\n analysis_error_response( email )\n arwi_id = get_arwi_id_for_decode( email )\n puts \"listener got arwi:#{arwi_id}\"\n return unless arwi_id && arwi_id.to_s.size > 0\n workitem = MailItem.get_workitem( arwi_id, 'delete', \"listener\" )\n puts \"listener can not got workitem for arwi:#{arwi_id}\" unless workitem\n return unless workitem\n puts \"listener got wi:#{workitem.class}, #{workitem}\"\n workitem[\"attachment\"] = email[:attachment]\n workitem[\"email_from\"] = email[:from].join(',')\n begin\n SMOperation.build( email, workitem )\n email[:subject] = Kconv.toutf8(email[:subject])\n # _ps_type = $1 if /\\+([a-z]+)?_?([\\d]+)@/ =~ email[:to]\n # step = SMSpreadsheet.get_stepname_from_spreadsheet( workitem.fei.wfname, _ps_type )\n event = Hash.new\n event[:title] = \"#{email[:subject]}\"\n event[:desc] = \"#{email[:body]}\"\n calendar_name = workitem.fields['user_name'] || 'default'\n SMGoogleCalendar.create_event( event, calendar_name )\n rescue Exception => e\n puts \"decode_workitem error: #{e.message}\"\n end\n print \"#{@blue_underline}3.listener processed workitem:#{@normal} #{workitem}\\n\"\n workitem\n end", "def do_custom_replacements_for(mail, recipient)\n end", "def process_message_response\n # Is this email confirming receipt of a previous message? \n msg_id = find_message_id_tag(:subject=>@subject, :body=>@body)\n#puts \"**** body=#{@body}, msg_id=#{msg_id}\"\n if msg_id \n # Does the \"confirmed message\" id actually match a message?\n message = Message.find_by_id(msg_id)\n if message\n msg_tag = message_id_tag(:id => msg_id, :action => :confirm_tag) # e.g. !2104\n search_target = Regexp.new('[\\'\\s\\(\\[]*' + \"#{Regexp.escape(msg_tag)}\" + '[\\'\\s\\.,\\)\\]]*')\n # The main reason to strip out the tag (like !2104) from the message is that it may be the\n # first part of the response, if there is one; e.g. \"!2104 Kafanchan\" replying to a message\n # requesting location. \n user_reply = first_nonblank_line(@body)\n#puts \"**** user_reply='#{user_reply}'\"\n user_reply = user_reply.sub(search_target, ' ').strip if user_reply\n # Mark all members with this email address as having responded to this message\n @possible_senders.each do |a_member|\n message.process_response(:member => a_member, :text => user_reply, :mode => 'email')\n end\n else\n msg_tag = message_id_tag(:id => msg_id, :action => :create, :location => :body)\n Notifier.send_generic(@from_address, I18n.t('error_msg.invalid_confirmation')).deliver\n end\n end\n end", "def receive(email, raw_email)\n # Find which info requests the email is for\n # We deliberately don't use Envelope-to here, so ones that are BCC\n # drop into the holding pen for checking.\n reply_info_requests = [] # XXX should be set?\n for address in (email.to || []) + (email.cc || [])\n reply_info_request = InfoRequest.find_by_incoming_email(address)\n reply_info_requests.push(reply_info_request) if reply_info_request\n end\n\n # Nothing found, so save in holding pen\n if reply_info_requests.size == 0 \n InfoRequest.holding_pen_request.receive(email, raw_email)\n return\n end\n\n # Send the message to each request, to be archived with it\n for reply_info_request in reply_info_requests\n reply_info_request.receive(email, raw_email)\n end\n end", "def work(raw_post)\n email_params = JSON.parse(raw_post).with_indifferent_access\n send_simple_message(params)\n ack! # we need to let queue know that message was received\n end", "def deliver\n Mail.new(from: from, to: formatted_to, body: sanitized_message).deliver!\n end", "def email_action documents\n mail = RecordMailer.email_record(documents, { to: params[:to], message: params[:message], config: blacklight_config }, url_options)\n if mail.respond_to? :deliver_now\n mail.deliver_now\n else\n mail.deliver\n end\n end", "def on_mail_from_event(ctx, mail_from_data); end", "def index\n @inbox = Email.to(@user.name)\n process_incoming(@inbox)\n @sent = Email.from(@user.name)\n end", "def deliver(reply = false, should_clean = true)\n self.clean if should_clean\n\n #Receiver receipts\n temp_receipts = recipients.map { |r| build_receipt(r, 'inbox') }\n\n #Sender receipt\n sender_receipt = build_receipt(sender, 'sentbox', true)\n\n temp_receipts << sender_receipt\n\n if temp_receipts.all?(&:valid?)\n temp_receipts.each(&:save!)\n Mailboxer::MailDispatcher.new(self, recipients).call\n\n conversation.touch if reply\n\n self.recipients = nil\n\n on_deliver_callback.call(self) if on_deliver_callback\n end\n sender_receipt\n end", "def process_receipts(_)\n Forwarder::process_receipts!\nend", "def delivering_email(message)\n if self.sanitize_engaged?(message)\n SanitizeEmail::MailHeaderTools.add_original_addresses_as_headers(message)\n SanitizeEmail::MailHeaderTools.prepend_custom_subject(message)\n\n o = SanitizeEmail::OverriddenAddresses.new(message)\n\n message.to = o.overridden_to\n message.cc = o.overridden_cc\n message.bcc = o.overridden_bcc\n end\n end", "def delivering_email(message)\n if self.sanitize_engaged?(message)\n SanitizeEmail::MailHeaderTools.add_original_addresses_as_headers(message)\n SanitizeEmail::MailHeaderTools.prepend_custom_subject(message)\n\n overridden = SanitizeEmail::OverriddenAddresses.new(message)\n\n message.to = overridden.overridden_to\n message.cc = overridden.overridden_cc\n message.bcc = overridden.overridden_bcc\n end\n end", "def convert_newsletter(mail)\n load File.expand_path(\"_script/convert-newsletters.rb\")\n converter = F2fConverter.new\n converter.convert_to_post(mail)\n converter.git_add\n end", "def deliver(reply = false, should_clean = true)\n self.clean if should_clean\n\n #Receiver receipts\n receiver_receipts = recipients.map { |r| build_receipt(r, 'inbox') }\n\n #Sender receipt\n sender_receipt = build_receipt(sender, 'sentbox', true)\n\n temp_receipts = [sender_receipt] + receiver_receipts\n\n if temp_receipts.all?(&:valid?)\n Mailboxer::MailDispatcher.new(self, receiver_receipts).call\n temp_receipts.each(&:save!)\n\n conversation.touch if reply\n\n self.recipients = nil\n\n on_deliver_callback.call(self) if on_deliver_callback\n end\n sender_receipt\n end", "def show\n @decrypted = @autocrypt.decrypt(@email)\n @reply_params = {\n to: @email.from,\n subject: 'Re: ' + @email.subject,\n body: (@decrypted || @email.body).gsub(/^/, '> ')\n }\n end", "def package\n raise \"Missing from address\" if self.from.nil?\n\n begin \n @envelope = TMail::Mail.new()\n rescue => e\n begin\n require 'tmail'\n @envelope = TMail::Mail.new()\n rescue MissingSourceFile, Gem::LoadError => e\n logger.error(\"TMail Gem wasn't found. Please install if you want to send mail.\")\n end\n end\n \n # http://tmail.rubyforge.org/rdoc/index.html\n @envelope.mime_version = \"1.0\"\n @envelope.charset = self.charset\n @envelope.message_id = self.message_id\n @envelope.from = [self.from]\n @envelope.to = [self.to] if self.to\n @envelope.cc = [self.cc] if self.cc\n @envelope.bcc = [self.bcc] if self.bcc\n @envelope.date = self.date\n @envelope.subject = self.subject\n \n html = TMail::Mail.new()\n html.body = self.render_result\n html.set_content_type('text','html')\n \n @envelope.parts << html\n @envelope.set_content_type('multipart', 'mixed') # needs to be set last or throws an error\n end", "def copy_attributes_from_raw_message\n if self.raw_message\n self.subject = self.headers['subject']&.last\n self.message_id = self.headers['message-id']&.last\n if self.message_id\n self.message_id = self.message_id.gsub(/.*</, '').gsub(/>.*/, '').strip\n end\n end\n end", "def patch_mail_port(port)\n return nil if port.nil?\n\n msg = nil\n use_raw_message = true\n begin\n mail = TMail::Mail.new(port)\n \n if mail.to.nil?\n use_raw_message = false\n if port.read_all.match(/To: (.+)\\n/)\n to_addresses = parse_addresses($1)\n mail.to = to_addresses\n print \"patching to addresses: #{to_addresses.join(', ')}\\n\"\n else\n mail.to = \"unknown@unknown.com\"\n print \"patching to addresses: #{mail.to}\\n\"\n end\n end\n \n if mail.from.nil?\n use_raw_message = false\n mail.from = @default_from\n print \"patching from address: #{mail.from}\\n\"\n end\n \n if mail.date.nil?\n use_raw_message = false\n # Eudora mbx files don't put the date in a Date: header\n # Instead they put it in the From line, like this:\n # From ???@??? Mon Oct 13 07:26:26 2003\n # We rebuild the message with the added date header.\n # The port (tmp file) has its utime set by TMail.\n mail.date = File.mtime(port.filename)\n print \"patching date: #{mail.date}\\n\"\n end\n \n # Eudora (and others?) don't specify html email.\n # We assume text/html content-type if body begins with <html>.\n if mail.body =~ /^\\s*\\<html\\>/ && !mail.content_type =~ /html/\n use_raw_message = false\n print \"setting text/html content type\\n\"\n mail.content_type = 'text/html'\n print \"patching content type: #{mail.content_type}\\n\"\n end\n \n if use_raw_message\n # Just use the message as read\n msg = port.read_all\n else\n msg = mail.encoded\n end\n rescue\n print \"could not parse mail message: #{$!}\\n\"\n end\n \n msg\n end", "def deliver(reply = false, should_clean = true)\n self.clean if should_clean\n temp_receipts = Array.new\n #Receiver receipts\n self.recipients.each do |r|\n msg_receipt = Receipt.new\n msg_receipt.notification = self\n msg_receipt.is_read = false\n msg_receipt.receiver = r\n msg_receipt.mailbox_type = \"inbox\"\n temp_receipts << msg_receipt\n end\n #Sender receipt\n sender_receipt = Receipt.new\n sender_receipt.notification = self\n sender_receipt.is_read = true\n sender_receipt.receiver = self.sender\n sender_receipt.mailbox_type = \"sentbox\"\n temp_receipts << sender_receipt\n\n temp_receipts.each(&:valid?)\n if temp_receipts.all? { |t| t.errors.empty? }\n temp_receipts.each(&:save!) \t#Save receipts\n self.recipients.each do |r|\n #Should send an email?\n if Mailboxer.uses_emails\n email_to = r.send(Mailboxer.email_method,self)\n unless email_to.blank?\n get_mailer.delay.send_email(self,r)\n end\n end\n end\n if reply\n self.conversation.touch\n end\n self.recipients=nil\n self.on_deliver_callback.call(self) unless self.on_deliver_callback.nil?\n end\n return sender_receipt\n end", "def convert_to_spam_email\n email = Email.find(email_id)\n email.spam = true\n email.save\n end", "def getContent(mail)\n#Converts some characters back to what they should be\n text = mail.text_part.body.decoded\n text.encode!(\"UTF-8\", \"Windows-1250\")\n text.gsub!(\"’\", \"\\'\") #fixes apostrophe bug for parsing\n text.gsub!(/(\\n){3,}/, \"\\n\\n\") #remove excess newlines\n return text\n end", "def deliver(should_clean = true)\n clean if should_clean\n self.push_data = self.push_data.gsub('[MESSAGE_ID]', self.id.to_s)\n temp_receipts = recipients.map { |r| build_receipt(r, 'inbox', false) }\n if temp_receipts.all?(&:valid?)\n temp_receipts.each(&:save!) #Save receipts\n Alerter::MessageDispatcher.new(self, recipients).call\n #self.recipients = nil\n end\n\n return temp_receipts if temp_receipts.size > 1\n temp_receipts.first\n end", "def on_mail_from_event(ctx, mail_from_data) end", "def deliver!(message)\n send_opts = {}\n send_opts[:raw_message] = {}\n send_opts[:raw_message][:data] = message.to_s\n\n if message.respond_to?(:destinations)\n send_opts[:destinations] = message.destinations\n end\n\n @client.send_raw_email(send_opts)\n\n end", "def mail_pdf(document,email,user,message)\n @user=user\n @document=document\n @email=email\n @message=message\n\n uri = URI.parse document.pdfdoc_url\n sock= Net::HTTP.new(uri.host, uri.port)\n sock.use_ssl=true\n response=sock.start { |http| http.get uri.path }\n attachments['document.pdf'] = response.body\n mail to: email, subject: \"Auto Chlor System - \" << document.description.upcase\n end", "def create\n @email_params = email_params\n @email_params[:body_plain] = @email_params['body-plain']\n @email_params[:stripped_html] = @email_params['stripped-html']\n @email_params[:body_html] = @email_params['body-html']\n ['body-plain', 'body-html', 'stripped-html'].collect{|p| @email_params.delete(p) }\n @email = Email.new(@email_params)\n @email.conversation_id = @email.find_conversation\n # We check if it's in the spam list. If that is the case, no conversation is created\n if Spam.search_pattern(@email.sender)\n @email.spam = true\n end\n if @email.save\n if @email.conversation\n @email.conversation.update_attribute(:read, false)\n @email.conversation.update_attribute(:answered, false)\n @email.conversation.update_attribute(:archived, false)\n end\n return render nothing: true, code: 200\n else\n return render nothing: true, code: 500\n end\n end", "def receive_inbound_email_from_source(*args); end", "def receive_inbound_email_from_source(*args); end", "def sync\n imap = imap_login\n imap.search([\"NOT\", \"SEEN\"]).each do |message_id|\n envelope = imap.fetch(message_id, \"ENVELOPE\")[0].attr[\"ENVELOPE\"]\n puts \"#{envelope.from[0].name}: \\t#{envelope.subject}\"\n\n # TODO right now we are hardcoding the regex's which are used in matching\n # and extracting data out of the incoming mail, at some point this\n # should be customizable by the end user\n\n # TODO we are assuming that all messages matching the criteria retrieved\n # from this imap account belong to this mailing list\n\n # handle subscription confirmation\n if envelope.subject =~ /^\\s*confirm\\s*([a-f0-9]*)\\s*$/\n puts \"confirm subscription #{$1}\"\n smtp = smtp_login\n message = message_for :address => request_address, :subject => \"confirm #{$1}\", :body => \"confirm #{$1}\"\n smtp.send_message message, @smtp_username, request_address\n smtp.finish\n\n # handle received patches\n elsif envelope.subject =~ /^\\s*\\[PATCH[^\\]]*\\]\\s*#([0-9]*).*$/i\n puts \"Received patch #{$2}\"\n puts \" Associating w/ issue ##{$1}\"\n\n issue = Issue.find $1\n patch = Patch.new :issue_id => issue.id,\n :mailing_list_id => self.id,\n :message_id => envelope.headers['Message-Id'],\n :subject => $2,\n :content => envelope.body\n patch.save!\n\n issue.status = IssueStatus.find_by_name(\"In Progress\")\n issue.save!\n\n # handle chained patches (first one may be the only one w/ the issue id)\n elsif envelope.subject =~ /^\\s*\\[PATCH[^\\]]*\\].*$/i\n # TODO handle multiple levels of patch replies\n parent_message_id = envelope.headers['In-Reply-To']\n parent_patch = Patch.find_by_message_id(parent_message_id)\n\n puts \"Received chained patch #{$2}\"\n puts \" Associating w/ issue ##{parent_patch.issue_id} (parent patch ##{parent_patch.id})\"\n\n patch = Patch.new :issue_id => parent_patch.issue_id,\n :mailing_list_id => self.id,\n :patch_id => parent_patch.id,\n :message_id => envelope.headers['Message-Id'],\n :subject => $2,\n :content => envelope.body\n\n patch.save!\n\n issue.status = IssueStatus.find_by_name(\"In Progress\")\n issue.save!\n\n # handle received patch comments\n elsif envelope.subject =~ /^\\s*RE:\\s*\\[PATCH[^\\]]*\\]\\s*#([0-9]*).*$/i\n # TODO handle multiple levels of replies\n parent_message_id = envelope.headers['In-Reply-To']\n parent_patch = Patch.find_by_message_id(parent_message_id)\n\n puts \"Received response to patch #{$2}\"\n puts \" Associating w/ patch ##{parent_patch.id}\"\n\n patch_comment = PatchComment.new :patch_id => parent_patch.id,\n :message_id => envelope.headers['Message-Id'],\n :content => envelope.body\n\n status = if envelope.body =~ /.*NACK.*/i\n IssueStatus.find_by_name(\"Rejected\")\n elsif envelope.body =~ /.*ACK.*/i\n IssueStatus.find_by_name(\"Resolved\")\n else\n IssueStatus.find_by_name(\"Feedback\")\n end\n\n issue.status = status\n issue.save!\n end\n\n\n end\n end", "def deliver!(message)\n send_opts = {}\n send_opts[:raw_message] = {}\n send_opts[:raw_message][:data] = message.to_s\n\n if message.respond_to?(:destinations)\n send_opts[:destinations] = message.destinations\n end\n\n @client.send_raw_email(send_opts)\n end", "def parse_mail(mail)\n\n @mail = mail\n\n unless mail.date.nil?\n self.sent_at = mail.date.strftime('%Y-%m-%d %H:%M:%S')\n end\n\n unless mail.from.nil?\n begin\n addrs = mail[:from].to_s\n addrs = EmailsHelper.split_preserving_quot(addrs, '\"', ',')\n self.from_address = addrs.join(Email::ADDRESS_SEPARATOR)\n rescue\n self.from_address = mail.from.join(Email::ADDRESS_SEPARATOR)\n end\n end\n\n unless mail.to.nil?\n begin\n addrs = mail[:to].to_s\n addrs = EmailsHelper.split_preserving_quot(addrs, '\"', ',')\n self.to_addresses = addrs.join(Email::ADDRESS_SEPARATOR)\n rescue\n self.to_addresses = mail.to.join(Email::ADDRESS_SEPARATOR)\n end\n end\n\n unless mail.cc.nil?\n begin\n addrs = mail[:cc].to_s\n addrs = EmailsHelper.split_preserving_quot(addrs, '\"', ',')\n self.cc_addresses = addrs.join(Email::ADDRESS_SEPARATOR)\n rescue\n self.cc_addresses = mail.cc.join(Email::ADDRESS_SEPARATOR)\n end\n end\n\n unless mail.bcc.nil?\n begin\n addrs = mail[:bcc].to_s\n addrs = EmailsHelper.split_preserving_quot(addrs, '\"', ',')\n self.bcc_addresses = addrs.join(Email::ADDRESS_SEPARATOR)\n rescue\n self.bcc_addresses = mail.bcc.join(Email::ADDRESS_SEPARATOR)\n end\n end\n\n unless mail.reply_to.nil?\n begin\n addrs = mail[:reply_to].to_s\n addrs = EmailsHelper.split_preserving_quot(addrs, '\"', ',')\n self.reply_to = addrs.join(Email::ADDRESS_SEPARATOR)\n rescue\n self.reply_to = mail.reply_to.join(Email::ADDRESS_SEPARATOR)\n end\n end\n\n self.subject = mail.subject\n\n # Email Body ###\n plain_part = (@mail.multipart?) ? ((@mail.text_part) ? @mail.text_part : nil) : nil\n html_part = (@mail.html_part) ? @mail.html_part : nil\n message_part = (plain_part || html_part)\n message_part ||= @mail unless @mail.multipart?\n\n if message_part.nil?\n self.message = ''\n else\n charset = @mail.header.charset\n charset = nil if !charset.nil? and (charset.casecmp('US-ASCII') == 0)\n\n charset ||= message_part.header.charset\n charset = nil if !charset.nil? and (charset.casecmp('US-ASCII') == 0)\n\n message = message_part.body.decoded\n unless charset.nil? or charset.empty?\n message.encode!(Encoding::UTF_8, charset, {:invalid => :replace, :undef => :replace, :replace => ' '})\n end\n self.message = message\n end\n end", "def email=(raw_email)\n begin\n e = TMail::Mail.parse(raw_email)\n self.subject = e.subject\n self.sender = e.from\n self.received_at = e.date\n # Encrypt and save email to disk file for async S3 upload job\n # Email content should only be unencrypted while in RAM (except for subject)\n logger.debug \"Saving encrypted email to #{temp_filename}\"\n raise EncryptionError.new(\"Email encryption failed\") unless encrypted = encrypt(raw_email)\n rio(temp_filename) < encrypted\n rescue\n logger.debug \"Unexpected error in #{self.class}.email=: \" + $!\n errors.add_to_base(\"Unexpected error in email=: \" + $!)\n end\n end", "def followup_send\n @id = params[:id] # Id of original message\n original_message = Message.find @id\n fu_message = Message.create(params[:record].merge(:following_up => @id)) # a new message object to send the follow up\n fu_message.members = original_message.members_not_responding\n fu_message.create_sent_messages # Sigh, we need this because contact list is generated upon _save_, and unless we\n # call create_sent_messages again (or use another tactic), the specified members\n # will not be included\n#puts \"**** fu_message.members =#{fu_message.members[0].last_name}, #{fu_message.members[0].primary_email}\"\n deliver_message(fu_message)\n flash[:notice] = 'Follow up message sent'\n redirect_to messages_path\n end", "def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end", "def process\n return 'OK' if @email.to.first[:token] == 'example'\n return process_image if @email.to.first[:token] == 'flyers'\n\n token = ReplyToken.find(@email.to.first[:token])\n\n case token.reply_type\n when 'participation_request'\n process_participation_request(token)\n when 'conversation'\n process_conversation(token)\n when 'comment'\n process_comment(token)\n when 'community'\n process_community_reply(token)\n end\n\n track_reply(token)\n\n token.use!\n end", "def remove_email_forward(source)\n validate_list([[\"Source\", source, :email] ])\n\n options = { \"Source\" => source }\n\n connection = Connection.new\n connection.post(\"Domain/EmailForward/Remove\", options)\n end", "def sms_action documents\n to = \"#{params[:to].gsub(/[^\\d]/, '')}@#{params[:carrier]}\"\n mail = RecordMailer.sms_record(documents, { to: to, config: blacklight_config }, url_options)\n if mail.respond_to? :deliver_now\n mail.deliver_now\n else\n mail.deliver\n end\n end", "def send_mail_from_raw_mime(params)\n begin\n raw_message = \"From: #{params[:sender_email]}\\nTo: #{params[:recipient]}\\nSubject: #{params[:subject].to_s}\\n\\n #{params[:content].to_s}\"\n\n from_email = params[:sender_email]#\"sender@example.com\"\n from_name = \"From Name\"\n to = params[:recipient]#[\"recipient.email@example.com\"]\n async = false\n ip_pool = \"Main Pool\"\n send_at = params[:send_at].presence || Time.now#\"example send_at\"\n return_path_domain = nil\n result = @mandrill.messages.send_raw raw_message, from_email, from_name, to, async, ip_pool, send_at, return_path_domain\n # [{\"reject_reason\"=>\"hard-bounce\",\n # \"email\"=>\"recipient.email@example.com\",\n # \"_id\"=>\"abc123abc123abc123abc123\",\n # \"status\"=>\"sent\"}]\n\n rescue Mandrill::Error => e\n # Mandrill errors are thrown as exceptions\n puts \"A mandrill error occurred: #{e.class} - #{e.message}\"\n # A mandrill error occurred: Mandrill::UnknownSubaccountError - No subaccount exists with the id 'customer-123'\n raise\n end\n end", "def call payload={}\n return payload unless payload[:text] # noope if there is no message to work on\n\n # not efficient, but it's an example :)\n options[:pairs].each do |from, to|\n payload[:text] = payload[:text].gsub from, to\n end\n\n payload # always return the payload from your middleware\n end", "def sanitize\n scrub_payload_emails\n scrub_actor_attributes\n end", "def send_new_mail(document)\n recipient = Recipient.where(document: document, sent: false).first\n if recipient.present?\n DocumentMailer.with(user: document.user,\n email: recipient.email,\n document: document).signature_email.deliver_later\n recipient.update(sent: true)\n DocumentEvent.create!(document: document, message: \"E-post sendt til #{recipient.email} \")\n if document.status != 1\n document.update!(status: 1)\n end\n else\n document.update!(status: 2)\n send_signature_complete_mail(document)\n end\n end", "def set_raw_mail\n @raw_mail = RawMail.find(params[:id])\n end", "def recruit_email(recipient, interaction, email)\n @interaction = interaction\n\n full_body = email.templated_body_for(recipient, :raw => true)\n reply_to = \"#{email.from.email_from} <#{email.from.email}>\"\n from = \"#{email.from.email_from} <athletics@scoutforce.com>\"\n\n mail(\n :to => recipient.email,\n :from => from,\n :reply_to => reply_to,\n :cc => email.cc,\n :bcc => email.bcc,\n :subject => email.subject,\n :'X-Mailgun-Variables' => %({\"recipient_id\" : \"#{recipient.id}\", \"email_id\" : \"#{email.id}\", \"interaction_id\" : \"#{interaction.id}\" })\n ) do |format|\n format.text\n format.html do\n render :text => full_body, :layout => true\n end\n end\n end", "def stopped_responses(info_request, email, raw_email_data)\n @from = contact_from_name_and_email\n headers 'Return-Path' => blackhole_email, 'Reply-To' => @from, # we don't care about bounces, likely from spammers\n 'Auto-Submitted' => 'auto-replied' # http://tools.ietf.org/html/rfc3834\n @recipients = email.from_addrs[0].to_s\n @subject = \"Your response to an FOI request was not delivered\"\n attachment :content_type => 'message/rfc822', :body => raw_email_data,\n :filename => \"original.eml\", :transfer_encoding => '7bit', :content_disposition => 'inline'\n @body = { \n :info_request => info_request,\n :contact_email => MySociety::Config.get(\"CONTACT_EMAIL\", 'contact@localhost') \n }\n end", "def inbound_email; end", "def inbound_email; end", "def handle_forward\n return unless elmo_response && elmo_response.valid?\n form = elmo_response.try(:form)\n\n if form && form.sms_relay?\n broadcast = ::Broadcast.new(\n recipient_selection: \"specific\",\n recipient_users: form.recipient_users,\n recipient_groups: form.recipient_groups,\n source: \"forward\",\n medium: \"sms_only\",\n body: incoming_msg.body,\n which_phone: \"both\",\n mission: incoming_msg.mission\n )\n\n if broadcast.valid?\n message = strip_auth_code(incoming_msg.body, form)\n return Sms::Forward.new(broadcast: broadcast, body: message, mission: broadcast.mission)\n end\n end\n\n nil\n end", "def send_one_email_to(name, mail)\n email = @gmail.compose do\n to mail\n subject \"Apprentissage entre pairs + gratuité + code = The Hacking Project\"\n html_part do\n content_type 'text/html; charset=UTF-8'\n body get_the_email_html(name) #TODO faire pour toutes les villes du tableau -> suppose de lire les colonnes du tableau dans une boucle (ajouter un délai)\n end\n end\nemail.deliver!\nend", "def assign_to_mail(mail)\n mail[:subject] = @subject if @subject\n mail[:bcc] = @bcc if @bcc\n mail[:cc] = @cc if @cc\n mail[:from] = @from if @from\n mail[:reply_to] = @reply_to if @reply_to\n\n @headers[::Message::DO_NOT_SEND_HEADER] = true if @do_not_send\n\n mail.headers @headers\n end", "def email_with_attachment(recipient_a, subject_a, user_a, org_fname, file_attach)\n @recipients = recipient_a\n @subject = subject_a\n @from = \"info@nrdpfc.ca\"\n @reply_to = \"info@nrdpfc.ca\"\n @body = subject_a \n part :content_type => \"multipart/mixed\" do |p|\n p.attachment :content_type => \"csv/text\", \n# :body => File.open(\"public/whale_batch.csv\", \"rb\") { |f| f.read },\n :body => file_attach,\n :filename => org_fname,\n :transfer_encoding => \"base64\",\n :charset => \"utf-8\"\n end \n end", "def plain_addresses(responder_id, data = [])\n responder responder_id\n data.each do |email|\n add_recipient email\n end\n end", "def receive(mail)\n mail\n end", "def recipient; end", "def forward_message_id=(*args); end", "def convert_to_recipient!\n update!(months_remaining: 0, converted_to_recipient: true)\n\n # NB donations will keep being rescheduled when they're expired (eg\n # Donation#schedule_next_donation), but they'll raise an ExpiredGift\n # error if they are. Let's detect those here and retry them.\n donor.donations.failed.first.try(:fix!)\n end", "def original_manuscript_uploaded(project, current_user)\n @project = project\n @current_user = current_user\n\n user_subject = \"Original Manuscript from #{current_user.name} for #{project.book_title}\"\n admin_subject = \"New \" + user_subject\n\n send_email_message('original_manuscript', {}, get_project_recipient_list(@project, roles: [:project_manager, :book_manager, :author]), user_subject)\n send_email_message('original_manuscript_admin', {}, admin_original_manuscript_list, admin_subject)\n end", "def attachment_update(design_review_document, user, subject_text)\n\n design_users = design_review_document.design.get_associated_users()\n to_list = []\n to_list << design_users[:designer].email if design_users[:designer]\n to_list << design_users[:peer].email if design_users[:peer]\n to_list << design_users[:pcb_input].email if design_users[:pcb_input]\n to_list += design_users[:reviewers].collect { |reviewer| reviewer.email }\n to_list.uniq!\n\n cc_list = ( Role.add_role_members(['Manager', 'PCB Input Gate']) -\n to_list).uniq\n\n subject = MailerMethods.subject_prefix(design_review_document.design) + subject_text\n\n @document = design_review_document\n @attached_by = user.name\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list\n ) \n\n end", "def contact_pub_copy(n)\n @offer = n.item\n @user = n.user\n @msg = n.msg\n @trade = n.trade\n headers['X-SMTPAPI'] = '{\"category\": \"Publisher contacts offerer copy\"}'\n mail(:to => n.user.email, :subject => \"You sent a message!\", :from => 'TradeYa <AdminRobot@TradeYa.com>', :content_type => \"text/html\")\n end", "def update\n respond_to do |format|\n if @raw_mail.update(raw_mail_params)\n format.html { redirect_to @raw_mail, notice: 'Raw mail was successfully updated.' }\n format.json { render :show, status: :ok, location: @raw_mail }\n else\n format.html { render :edit }\n format.json { render json: @raw_mail.errors, status: :unprocessable_entity }\n end\n end\n end", "def handle_forward(sms, elmo_response)\n form = elmo_response.try(:form)\n\n if form && form.sms_relay?\n broadcast = ::Broadcast.new(\n recipient_selection: \"specific\",\n recipient_users: form.recipient_users,\n recipient_groups: form.recipient_groups,\n source: \"forward\",\n medium: \"sms_only\",\n body: sms.body,\n which_phone: \"both\",\n mission: sms.mission\n )\n\n if broadcast.save\n message = strip_auth_code(sms.body, form)\n return Sms::Forward.new(broadcast: broadcast, body: message, mission: broadcast.mission)\n end\n end\n\n nil\n end" ]
[ "0.64977014", "0.6424124", "0.63283294", "0.6274577", "0.5993774", "0.5918794", "0.5916153", "0.582899", "0.58096135", "0.5710799", "0.5679788", "0.5650706", "0.5617321", "0.55787796", "0.55785877", "0.5576686", "0.55626917", "0.55534476", "0.5546139", "0.5511874", "0.5496006", "0.5482983", "0.5473164", "0.5461157", "0.5452953", "0.5444124", "0.5437165", "0.5417554", "0.53964067", "0.53920716", "0.5383867", "0.5376674", "0.5354413", "0.53498805", "0.5334552", "0.53327", "0.53209835", "0.529485", "0.52906066", "0.5275004", "0.52731687", "0.52571976", "0.5252133", "0.5243708", "0.5243669", "0.5240134", "0.5231796", "0.5231145", "0.522679", "0.52182937", "0.52110505", "0.5210539", "0.5209359", "0.5205637", "0.5201158", "0.51947695", "0.51794773", "0.5171683", "0.5167933", "0.51548487", "0.5150342", "0.5148913", "0.51471996", "0.512041", "0.5100328", "0.50889194", "0.50819767", "0.50819767", "0.50808156", "0.5080512", "0.5073365", "0.5071922", "0.5067059", "0.50606215", "0.5053839", "0.50464594", "0.5042854", "0.50414664", "0.5040034", "0.50379884", "0.5033231", "0.50325555", "0.5028332", "0.5024949", "0.50215495", "0.50215495", "0.50103587", "0.5005256", "0.49973282", "0.49963647", "0.49901095", "0.49897224", "0.49895", "0.49779052", "0.49755403", "0.49704298", "0.49681768", "0.49591115", "0.49577102", "0.49553746" ]
0.71392787
0
Send decoded documents back to sender
def deliver_rts email, documents, mail_to logger.info "Sending response mail to #{mail_to}" mail = Mail.new mail.from @cfg[:from] mail.to mail_to # CCs to the original email will get a copy of the converted files as well mail.cc (email.cc - email.to - (@cfg[:cc_blacklist]||[]) ) if email.cc # Prevent autoheathen infinite loop! # Don't prepend yet another Re: mail.subject "#{'Re: ' unless email.subject.start_with? 'Re:'}#{email.subject}" # Construct received path # TODO: is this in the right order? #rcv = "by localhost(autoheathen); #{Time.now.strftime '%a, %d %b %Y %T %z'}" #[email.received,rcv].flatten.each { |rec| mail.received rec.to_s } mail.return_path email.return_path if email.return_path mail.header['X-Received'] = email.header['X-Received'] if email.header['X-Received'] documents.each do |doc| next if doc[:content].nil? mail.add_file filename: doc[:filename], content: doc[:content] end cfg = @cfg # stoopid Mail scoping me = self # stoopid Mail scoping mail.text_part do s = Haml::Engine.new( me.read_file cfg[:text_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg) body s end mail.html_part do content_type 'text/html; charset=UTF-8' s = Haml::Engine.new( me.read_file cfg[:html_template] ).render(Object.new, to: mail_to, documents: documents, cfg: cfg) body s end mail.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port] deliver mail end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive\n begin\n message = save_message\n rescue => err\n render :text => err.message, :status => 400\n return\n end\n \n begin\n message.process! params\n rescue => err\n message.reply = err.message\n ensure\n if (message.reply != \"Invalid command\")\n collection_id = get_collection_id(params[:body])\n if collection_id and collection_id >0\n message[:collection_id] = collection_id\n end\n end\n message.save\n render :text => message.reply, :content_type => \"text/plain\"\n end\n end", "def documents; end", "def documents; end", "def documents\n reply ? reply.documents : []\n end", "def download_origin\n send_data(@document.original_file, type: @document.data_type, filename: @document.name)\n end", "def show\n send_data(@document.file_contents,\n type: @document.content_type,\n filename: @document.filename)\n end", "def receive_document(doc)\n folder.documents << doc\n end", "def create\n @oa_sent_document = Oa::SentDocument.new(oa_sent_document_params)\n #@recv_document = Oa::RecvDocument.find_by_id(params[:recv_document_id])\n respond_to do |format|\n if @oa_sent_document.save\n format.html { render :js => view_context.close_window_show_tips('parent.MAIN_LAYER_WINDOW','发文创建成功!') }\n format.json { render :show, status: :created, location: @oa_sent_document }\n else\n format.html { render :new }\n format.json { render json: @oa_sent_document.errors, status: :unprocessable_entity }\n end\n end\n #respond_to do |format|\n # if @oa_sent_document.save_with_recv(@recv_document) && @oa_sent_document.launch((@recv_document.process.id if @recv_document))\n # format.html { redirect_to edit_oa_sent_document_url(@oa_sent_document), notice: '拟文创建成功' }\n # format.json { render json: @oa_sent_document, status: :created, location: @oa_sent_document }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @oa_sent_document.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def download\n send_file @document.complete_path, :type => @document.mime, :disposition => 'inline'\n end", "def doc_raptor_send(options = {})\n default_options ={\n :name => controller_name,\n :document_type => request.format.to_sym,\n :test => true\n }\n\n options = default_options.merge(options)\n options[:document_content] ||= render_to_string\n ext = options[:document_type].to_sym\n \n response = DocRaptor.create(options)\n if response.code == 200\n send_data response, :filename => \"#{options[:name]}.#{ext}\", :type => ext\n else\n render :inline => response.body, :status => response.code\n end\n end", "def convert()\n @helper.post(@fields, @files, @raw_data)\n end", "def attachments\n model_documents = self.model_documents.reverse\n end", "def show\n send_data(@document.file_content,\n type: @document.content_type,\n filename: @document.filename)\n end", "def download_raw\n document = Document.find(params[:id])\n authorize! :download_raw, document\n \n begin\n upload = Upload.find( document.stuffing_upload_id )\n rescue ActiveRecord::RecordNotFound => e\n puts \"### ERROR: \" + e.message\n redirect_to show_data_path(document), notice: \"ERROR: file (upload) ID not found. Upload may have been deleted\"\n return\n end\n \n send_file upload.upfile.path, \n :filename => upload.upfile_file_name, \n :type => 'application/octet-stream'\n end", "def process\n convert\n render\n write\n end", "def deliver_onward email, documents, mail_to\n logger.info \"Sending response mail to #{mail_to}\"\n email.cc [] # No CCing, just send to the recipient\n email.to mail_to\n email.subject \"#{'Fwd: ' unless email.subject.to_s.start_with? 'Fwd:'}#{email.subject}\"\n email.return_path email.from unless email.return_path\n # something weird goes on with Sharepoint, where the doc is dropped on the floor\n # so, remove any offending headers\n email.message_id = nil # make sure of message_id too\n good_headers = ONWARD_HEADERS.map{ |h| h.downcase }\n inspect_headers = email.header.map(&:name)\n inspect_headers .each do |name|\n unless good_headers.include? name.downcase \n email.header[name] = nil\n end\n end\n email.received = nil # make sure of received\n # replace attachments with converted files\n email.parts.delete_if { |p| p.attachment? }\n documents.each do |doc|\n if doc[:content]\n email.add_file filename: doc[:filename], content: doc[:content]\n else # preserve non-converted attachments when forwarding\n email.add_file filename: doc[:orig_filename], content: doc[:orig_content]\n end\n end\n email.delivery_method :smtp, address: @cfg[:mail_host], port: @cfg[:mail_port]\n deliver email\n end", "def show # becomes download\n @document = Document.find(params[:id])\n # send_data @document.data, :filename => @document.filename, \n # :type => @document.content_type, \n # :disposition => \"inline\"\n send_data @document.data, :filename => @document.filename, :type => @document.content_type\n end", "def send_json label, obj\n # parse before send in case of issues\n message = obj.to_json\n @publisher.send_string label, ZMQ::SNDMORE\n @publisher.send_string message\n end", "def show\n #prawnto :inline => false\n @document = Document.find(params[:id])\n set_unseen_emails_count @document unless @document.seen\n #fire_log session.session_id\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @document }\n#\t\t\tformat.pdf { send_data render_pdf( @document ), \n#\t\t\t\t:type => 'application/pdf', :disposition => 'inline' }\n format.pdf\n end\n end", "def body\n @document.to_s\n end", "def from_document doc\n d = {}.tap do |d|\n d[:id] = doc[:_id]\n d[:time] = doc[:_t]\n d[:body] = doc[:_d]\n end.compact\n receive! d\n self\n end", "def process\n demarshal\n end", "def kif_data_send\n if request.format.bod?\n text_body = KifuParser.new(source: current_record.kifu_body, to_format: \"bod\", turn: params[:turn]).to_xxx\n else\n text_body = current_record.to_xxx(params[:format])\n end\n\n if current_body_encode == \"Shift_JIS\"\n text_body = text_body.encode(current_body_encode)\n end\n\n # if boolean_for(params[:plain])\n # render plain: text_body\n # return\n # end\n\n if current_disposition == :inline\n headers[\"Content-Type\"] = current_type\n render plain: text_body\n return\n end\n\n # inline でこれを表示すると headers[\"Content-Transfer-Encoding\"] = \"binary\" になっているため Capybara でテキストが文字化けする\n # filename = current_filename.public_send(\"to#{current_filename_encode}\")\n send_data(text_body, type: current_type, filename: current_filename, disposition: current_disposition)\n end", "def save(doc)\n doc = encode_attachments_of(doc)\n\n if doc['_id']\n server.put(\"#{name}/#{CGI.escape(doc['_id'])}\", doc)\n else\n server.post(\"#{name}\", doc)\n end\n end", "def flush\n body.to_s\n self\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"attachments\", @attachments)\n writer.write_collection_of_object_values(\"bccRecipients\", @bcc_recipients)\n writer.write_object_value(\"body\", @body)\n writer.write_string_value(\"bodyPreview\", @body_preview)\n writer.write_collection_of_object_values(\"ccRecipients\", @cc_recipients)\n writer.write_string_value(\"conversationId\", @conversation_id)\n writer.write_object_value(\"conversationIndex\", @conversation_index)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_object_value(\"flag\", @flag)\n writer.write_object_value(\"from\", @from)\n writer.write_boolean_value(\"hasAttachments\", @has_attachments)\n writer.write_enum_value(\"importance\", @importance)\n writer.write_enum_value(\"inferenceClassification\", @inference_classification)\n writer.write_collection_of_object_values(\"internetMessageHeaders\", @internet_message_headers)\n writer.write_string_value(\"internetMessageId\", @internet_message_id)\n writer.write_boolean_value(\"isDeliveryReceiptRequested\", @is_delivery_receipt_requested)\n writer.write_boolean_value(\"isDraft\", @is_draft)\n writer.write_boolean_value(\"isRead\", @is_read)\n writer.write_boolean_value(\"isReadReceiptRequested\", @is_read_receipt_requested)\n writer.write_collection_of_object_values(\"multiValueExtendedProperties\", @multi_value_extended_properties)\n writer.write_string_value(\"parentFolderId\", @parent_folder_id)\n writer.write_date_time_value(\"receivedDateTime\", @received_date_time)\n writer.write_collection_of_object_values(\"replyTo\", @reply_to)\n writer.write_object_value(\"sender\", @sender)\n writer.write_date_time_value(\"sentDateTime\", @sent_date_time)\n writer.write_collection_of_object_values(\"singleValueExtendedProperties\", @single_value_extended_properties)\n writer.write_string_value(\"subject\", @subject)\n writer.write_collection_of_object_values(\"toRecipients\", @to_recipients)\n writer.write_object_value(\"uniqueBody\", @unique_body)\n writer.write_string_value(\"webLink\", @web_link)\n end", "def from_response(user, response)\n base_documents_data = response['documents']\n base_documents_data.map do |base_document_data|\n physical_docs = base_document_data['physical_docs'].map do |data|\n doc = PhysicalDocument.from_response(data)\n doc.base_document = self\n doc\n end\n social_docs = base_document_data['social_docs'].map do |data|\n doc = SocialDocument.from_response(data)\n doc.base_document = self\n doc\n end\n virtual_docs = base_document_data['virtual_docs'].map do |data|\n doc = VirtualDocument.from_response(data)\n doc.base_document = self\n doc\n end\n\n args = {\n \"user\"=>user,\n \"id\"=>base_documents_data.first['id'],\n \"name\"=>base_documents_data.first['name'],\n \"permission_scope\"=>base_documents_data.first['permission_scope'],\n \"address_city\"=>base_documents_data.first['address_city'],\n \"address_country_code\"=>base_documents_data.first['address_country_code'],\n \"address_postal_code\"=>base_documents_data.first['address_postal_code'],\n \"address_street\"=>base_documents_data.first['address_street'],\n \"address_subdivision\"=>base_documents_data.first['address_subdivision'],\n \"alias\"=>base_documents_data.first['alias'],\n \"birth_day\"=>base_documents_data.first['day'],\n \"email\"=>base_documents_data.first['email'],\n \"entity_scope\"=>base_documents_data.first['entity_scope'],\n \"entity_type\"=>base_documents_data.first['entity_type'],\n \"ip\"=>base_documents_data.first['ip'],\n \"birth_month\"=>base_documents_data.first['month'],\n \"phone_number\"=>base_documents_data.first['phone_number'],\n \"birth_year\"=>base_documents_data.first['year'],\n \"screening_results\"=>base_documents_data.first['screening_results'],\n \"physical_documents\"=>physical_docs,\n \"social_documents\"=>social_docs,\n \"virtual_documents\"=>virtual_docs\n }\n\n other_keys = base_document_data.keys\n\n [\"physical_docs\", \"social_docs\", \"virtual_docs\"].each do |item|\n other_keys.delete_at(other_keys.index(item))\n end\n\n for key in other_keys do\n if base_document_data.has_key?(key)\n args[key] = base_document_data[key]\n end\n end\n\n base_doc = self.new(args)\n [physical_docs, social_docs, virtual_docs].flatten.each do |doc|\n doc.base_document = base_doc\n end\n\n base_doc\n end\n end", "def _send_point(body)\n body.each_slice(100) do |p|\n conn.post('/?f=wavefront', p.join(\"\\n\"), 'application/octet-stream')\n end\n end", "def download\n document = Document.find(params[:document_id])\n tempfile = open(document.url)\n send_data tempfile.read, :filename => document.title, :type => document.content_type\n end", "def show\n send_data( Base64.decode64(@note.file_contents),\n type: @note.content_type,\n filename: @note.filename)\nend", "def show\n Iconv.open('UTF-8//IGNORE', 'UTF-8') do |ic|\n @document[:content] = ic.iconv(File.open(@document.attachment.path, 'r').read)\n end\n end", "def process!(document); end", "def forward_message(params={})\n response.from = request.from\n response.reply_to = settings.service.default_sender \n response.subject = request.subject\n\n params.each do |k,v|\n response.send(\"#{k}=\", v)\n end\n\n if request.multipart?\n response.text_part = request.text_part\n response.html_part = request.html_part\n else\n response.body = request.body.to_s\n end\n end", "def remote_data\n render :json => build_remote_data( params[:document_id] )\n end", "def send_data\n @propeller.transmit\n end", "def transmit_document!\n version_id = document_version_ref_id\n version_id.present? ? update_document(version_id) : upload_document\n end", "def documents\n Hancock::Request.send_get_request(\"/envelopes/#{envelope_id}/documents\")[\"envelopeDocuments\"]\n end", "def receiving(data); end", "def receiving(data); end", "def as_received\n raw_data\n end", "def parse_body(buffer)\n super(buffer)\n @id = shift_short(buffer)\n @topics << shift_string(buffer) while buffer.bytesize > 0\n end", "def decode(binary); ::BSON.deserialize(binary); end", "def payload_from_doc(req, doc, opts = {})\n if doc.is_a?(IO) || doc.is_a?(StringIO) || doc.is_a?(Tempfile) # attachments\n req[:header]['Content-Type'] = mime_for(req[:uri].path)\n doc\n elsif opts[:raw] || doc.nil?\n doc\n else\n MultiJson.encode(doc.respond_to?(:as_couch_json) ? doc.as_couch_json : doc)\n end\n end", "def send_body\n\t\t\tif @content\n\t\t\t\tsend_content\n\t\t\telsif @chunks\n\t\t\t\tsend_chunks\n\t\t\telsif @multiparts\n\t\t\t\tsend_multiparts\n\t\t\telse\n\t\t\t\t@content = \"\"\n\t\t\t\tsend_content\n\t\t\tend\n\t\tend", "def write_raw(obj,encoding = 3)\n\t @stream = \"\" #new output stream\n\t RequestStore.amf_encoding = (encoding == 3) ? 'amf3' : 'amf0'\n\t reset_referencables\n\t write(obj)\n\t @stream\n\tend", "def parse\n return @document if @document\n\n @document = super @text, @format\n @document.file = @location\n @document\n end", "def download_document\n doc_name = Event::Document::MAPPING[params[:name].to_sym]\n pdf = File.new(\"public/documents/#{doc_name}\")\n pdf_data = File.read(pdf.path)\n begin\n send_data(pdf_data, type: 'application/pdf', filename: doc_name)\n ensure\n pdf.close\n end\n end", "def raw\n\t\t#puts \"raw, line \" + \"27\"\n\t\t@raw = ssl.find({id: params[:id]}).to_a.first\n\t\tif @raw.nil?\n\t\t\tredirect_to doc_index_path, notice: 'No record of doc with id: ' + params[:id].to_s \n \t\telse\n \t\t\trender json: @raw \n\t\tend\n \tend", "def serialize\n ArtistMessage.encode(to_message)\n end", "def docusign_response_order\n utility = DocusignRest::Utility.new\n\n if params[:event] == \"signing_complete\"\n temp_file = Tempfile.open([\"docusign_response_\",\".pdf\"], Rails.root.join('tmp'), :encoding => 'ascii-8bit')\n\n begin\n DOCUSIGN_CLIENT.get_document_from_envelope(\n envelope_id: params[\"envelope_id\"],\n document_id: 1,\n local_save_path: temp_file.path\n )\n\n box_info = session[params[\"envelope_id\"]]\n\n box_user = user_client\n completedPath = \"#{session[:userinfo]['info']['name']}\\ -\\ Order\\ Forms\"\n signed_folder = box_user.folder_from_path(completedPath)\n file = box_user.upload_file(temp_file.path, signed_folder)\n box_user.update_file(file, name: \"Order Form #{DateTime.now} - SIGNED.pdf\")\n\n box_user.delete_file(box_info[:box_doc_id])\n\n ensure\n temp_file.delete\n end\n\n flash[:notice] = \"Order form signed and submitted to a company representative.\"\n render :text => utility.breakout_path(product_supply_path(page_redirect: \"orders\")), content_type: 'text/html'\n else\n flash[:error] = \"You chose not to sign the document.\"\n render :text => utility.breakout_path(product_supply_path(page_redirect: \"orders\")), content_type: 'text/html'\n end\n end", "def documents\n if acknowledged?\n replies.flat_map(&:documents)\n else\n []\n end\n end", "def show\n @response, @document = search_service.fetch params[:id]\n @documents = [ @document ]\n set_bag_name \n logger.info \"es287_debug #{__FILE__}:#{__LINE__}:#{__method__} params = #{params.inspect}\"\n respond_to do |format|\n format.endnote_xml { render :layout => false } #wrapped render :layout => false in {} to allow for multiple items jac244\n format.endnote { render :layout => false } #wrapped render :layout => false in {} to allow for multiple items jac244\n format.html {setup_next_and_previous_documents}\n format.rss { render :layout => false }\n format.ris { render 'ris', :layout => false }\n #format.ris { render \"ris\", :layout => false }\n # Add all dynamically added (such as by document extensions)\n # export formats.\n @document.export_formats.each_key do | format_name |\n # It's important that the argument to send be a symbol;\n # if it's a string, it makes Rails unhappy for unclear reasons.\n format.send(format_name.to_sym) { render :body => @document.export_as(format_name), :layout => false }\n end\n\n end\n end", "def show\n @oa_sent_document = Oa::SentDocument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @oa_sent_document }\n end\n end", "def serialize\n ArtistMessage.encode(self.to_message)\n end", "def index\n params.delete :utf8\n @documents = Document.filter(params)\n #@documents = Document.all\n\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @documents }\n end\n end", "def sms_action documents\n to = \"#{params[:to].gsub(/[^\\d]/, '')}@#{params[:carrier]}\"\n mail = RecordMailer.sms_record(documents, { to: to, config: blacklight_config }, url_options)\n if mail.respond_to? :deliver_now\n mail.deliver_now\n else\n mail.deliver\n end\n end", "def reply(data)\n res.json(Satz.serializer.dump(data))\n end", "def client_final_message\n BSON::Binary.new(\"#{without_proof},p=#{client_final}\")\n end", "def send_to_ocr\n run_callbacks :send_to_ocr do\n self.response = http.request(request)\n self.response_body = JSON.parse(response.body)\n end\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"attachments\", @attachments)\n writer.write_object_value(\"body\", @body)\n writer.write_string_value(\"conversationId\", @conversation_id)\n writer.write_string_value(\"conversationThreadId\", @conversation_thread_id)\n writer.write_collection_of_object_values(\"extensions\", @extensions)\n writer.write_object_value(\"from\", @from)\n writer.write_boolean_value(\"hasAttachments\", @has_attachments)\n writer.write_object_value(\"inReplyTo\", @in_reply_to)\n writer.write_collection_of_object_values(\"multiValueExtendedProperties\", @multi_value_extended_properties)\n writer.write_collection_of_object_values(\"newParticipants\", @new_participants)\n writer.write_date_time_value(\"receivedDateTime\", @received_date_time)\n writer.write_object_value(\"sender\", @sender)\n writer.write_collection_of_object_values(\"singleValueExtendedProperties\", @single_value_extended_properties)\n end", "def print_marked\n @letters = Letter.find(:all, :conditions => {:id => marked_records.to_a})\n render :xml => @letters.to_xml\n mime_type = \"application/msword\"\n @user = current_user\n @file = DataFile.do_rtf(@user, @letters)\n # Send the new file with the wordprocessingml document\n # content type.\n send_file(@file, :filename => Russian.t(:letters) + \" - \" + Time.now.to_s + \".doc\", :type => mime_type)\n @letters.each do |letter|\n \n @answer = letter.make_answer\n if not @answer.answered\n @answer.update_attribute(:answered, true) \n end\n #@answer.update_attribute(:answer_date, Time.now)\n end\n #marked_records.clear\n end", "def receive\n parse(recv)\n end", "def encode_end(real_payload, reqs, encoded)\n encoded\n end", "def document(reload = false)\n response_body(reload)\n end", "def send_and_receive\n url = to_s\n raw_response = HTTPClient.new.get(url).body\n parsed_response = BEncode::Parser.new(StringIO.new(raw_response))\n parsed_response.parse!\n end", "def documents\n reply.documents[0][RESULTS] || reply.documents[0][RESULT]\n end", "def run\n AMQP.start(:host => '127.0.0.1') do\n MQ.new.queue('encoder_listener').bind(MQ.new.fanout(RemoteRecorder::FANOUT_EXCHANGE)).subscribe do |json|\n # check if the message is a recording finished message\n DaemonKit.logger.debug(\"Got message: #{json}\")\n message = JSON.parse(json)\n if message[\"message\"] == \"recording_finished\"\n DaemonKit.logger.debug(\"Got recording finish message: #{message}\")\n # add the encoding job to the queue\n @queue.unshift({\n :id => message[\"doc_id\"],\n :files => message[\"files\"]\n })\n process_queue\n end\n end\n EM.add_periodic_timer(1.0) do\n watch\n process_queue\n end\n # periodically check whether we for some reason missed a video\n # which is sitting unencoded somewhere\n EM.add_periodic_timer(15) do\n @db.get(\"_design/video_encoder\").view(\"unencoded\")['rows'].each{|v|\n unless @queue.collect{|x| x[:id]}.include? v[\"value\"][\"_id\"]\n @queue.unshift({\n :id => v[\"value\"][\"_id\"],\n :files => v[\"value\"][\"files\"]\n })\n end\n }\n end\n end\n end", "def payload_from_doc(doc, opts = {})\n if (opts.delete(:raw) || doc.nil? || doc.is_a?(IO) || doc.is_a?(Tempfile))\n doc\n else\n MultiJson.encode(doc.respond_to?(:as_couch_json) ? doc.as_couch_json : doc)\n end\n end", "def test_post_save_document_as_from_pdf_to_doc\n filename = '45.pdf'\n remote_name = 'TestPostDocumentSaveAsFromPdfToDoc.docx'\n dest_name = remote_test_out + 'TestPostDocumentSaveAs.docx'\n save_options = SaveOptionsData.new({:SaveFormat => 'docx', :FileName => dest_name})\n\n st_request = PutCreateRequest.new remote_test_folder + test_folder + '/' + remote_name, File.open(local_test_folder + test_folder + '/' + filename, \"r\").read\n @storage_api.put_create st_request\n\n request = PostDocumentSaveAsRequest.new remote_name, save_options, remote_test_folder + test_folder, :dest_file_name => dest_name\n result = @words_api.post_document_save_as request\n assert_equal 200, result.code\n end", "def show\n render json: @uploaded_document\n end", "def reencode(body, content_type = T.unsafe(nil)); end", "def reencode(body, content_type = T.unsafe(nil)); end", "def encode_body(buffer)\n # Encode the message count.\n buffer << {\n :count => messages.length\n }.to_msgpack\n \n # Encode all the messages.\n messages.each do |message|\n message.encode(buffer)\n end\n end", "def show\n respond_to do |format|\n format.html\n format.json\n format.pdf do\n pdf = Prawn::Document.new\n pdf.text \"Alerte #{@alerte.code}\"\n #send_data pdf.render, filename: \"document_#{@alerte.code}.pdf\", type: 'application/pdf', disposition: 'inline'\n end\n end\n render layout: 'views/index'\n end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def document; end", "def create\n @document = Document.new(document_params)\n case @document.doc_type\n when 'registration_certificate'\n case @document.language\n when \"English\"\n @translation = EnglishRegistrationCertificate.new()\n @translation.document = @document\n\n #here comes preProcessing and OCR things\n end\n else\n #here should be redirection to document#new\n end\n\n respond_to do |format|\n if @document.save\n params[:document_images]['image'].each do |i|\n @document_image = @document.document_images.create!(:image => i)\n @imageUrl = @document_image.image.current_path\n @imageDimensions = FastImage.size(@imageUrl) #=> [x,y]\n\n #working stuff\n response = Ocr.processDocument(@document.doc_type, @document.language, @document.document_images.load)\n @xmlTranslation = Nokogiri::XML(response)\n\n #\n # Temporary\n #\n @translation.registrationNumber = '1234567'\n @translation.circle = 'ABC 123 kółko'\n @translation.registeredKeeper = \"Andrzej Strzelba\"\n @translation.referenceNumber = \"1234 5678 90\"\n @translation.previousRegisteredKeeper = \"Bartek Walaszek, BFF\"\n @translation.dateOfPurchase = \"20.11.2014\"\n @translation.numberOfPreviousOwners = \"3\"\n @translation.specialNotes = \"Niemiec płakał jak sprzedawał. Niemiec odwoził do granicy!\"\n\n #\n # Here comes the XML parser\n #\n @translation.parseResponse(response)\n\n #\n # BTW. translation variable 4 document is sensless - we have to remove it as soon as possible :: when parsed response will be saved in database (EnglishRegistrationCetificate)\n #\n @document.translation = @xmlTranslation.css(\"value\").text\n\n #\n # @document variables should be set before savin' !!\n #\n\n @document.save\n end\n\n if @translation.save\n\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n @document.destroy\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "def decode_attachments\n self[\"_attachments\"].each do |attachment_id, attachment_properties|\n self[\"_attachments\"][attachment_id][\"data\"] = Base64.decode64 attachment_properties[\"data\"] if attachment_properties[\"data\"] \n end if self[\"_attachments\"]\n end", "def sign_document_status\n puts \"------ JSON que veio ------\"\n document_data = JSON.parse(request.body.read)\n puts document_data\n\n puts \"------ Nossa transformação ------\"\n document_data.deep_symbolize_keys!\n puts document_data\n\n puts \"----- doc_key: #{document_data[:document][:key]} -----------\"\n # testar escrever @operation como operation\n @operation = Operation.new\n\n if request.headers[\"Event\"] == \"auto_close\"\n @operation = Operation.find_by_sign_document_key(document_data[:document][:key])\n @operation.signed_at = Time.current\n @operation.signed = true\n @operation.save!\n SlackMessage.new(\"CHQFGD43Y\", \"<!channel> o contrato da *Operação #{@operation.id}* foi completamente assinado\").send_now\n elsif request.headers[\"Event\"] == \"sign\"\n @operation = Operation.find_by_sign_document_key(document_data[:document][:key])\n signer_email = document_data[:event][:data][:signer][:email]\n new_sign_document_info = @operation.sign_document_info.deep_symbolize_keys\n new_sign_document_info[:signer_signature_keys].each do |signer_signature_key|\n if signer_signature_key[:email] == signer_email\n signer_signature_key.store(:status, \"signed\")\n SlackMessage.new(\"CHQFGD43Y\", \"<!channel> #{signer_email} assinou o contrato da *Operação #{@operation.id}*\").send_now\n end\n end\n @operation.sign_document_info = new_sign_document_info\n @operation.save!\n end\n # testar tirar esse authorize\n authorize @operation\n render body: {}.to_json, status: :created\n\n end", "def create\n @document = Document.new()\n @document.process params[:document][:file]\n \n respond_to do |format|\n if @document.save\n format.html { redirect_to :action => :index , notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "def save doc\n if doc['_attachments']\n doc['_attachments'] = encode_attachments(doc['_attachments'])\n end\n if doc['_id']\n slug = CGI.escape(doc['_id'])\n CouchRest.put \"#{@root}/#{slug}\", doc\n else\n CouchRest.post \"#{@root}\", doc\n end\n end" ]
[ "0.54869807", "0.5417447", "0.5417447", "0.53679866", "0.5307356", "0.5301398", "0.53003854", "0.5299064", "0.52919436", "0.52829903", "0.52796304", "0.5253086", "0.52505875", "0.52391064", "0.52151275", "0.5201595", "0.51985765", "0.51840144", "0.51640135", "0.5142425", "0.513499", "0.5128753", "0.510604", "0.50926346", "0.50883317", "0.5088263", "0.5087682", "0.5082774", "0.5078899", "0.5077796", "0.50714254", "0.50642353", "0.5063269", "0.5060221", "0.50369996", "0.5027239", "0.50261194", "0.500852", "0.500852", "0.50032836", "0.4999235", "0.49892274", "0.49762717", "0.49726015", "0.4966945", "0.4963412", "0.49525192", "0.49510723", "0.49280068", "0.4926024", "0.4910418", "0.4908921", "0.49013808", "0.49013323", "0.48969468", "0.48806375", "0.48787278", "0.48747456", "0.48722962", "0.48621678", "0.4859692", "0.48577008", "0.48571014", "0.4853915", "0.4846619", "0.48363832", "0.48355442", "0.48242292", "0.48208335", "0.48188433", "0.48167822", "0.48167822", "0.481224", "0.48120525", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.48092136", "0.4807018", "0.48038244", "0.48023522", "0.47973073", "0.4790131" ]
0.49734047
43
Convenience method allowing us to stub out actual mail delivery in RSpec
def deliver mail if @cfg[:deliver] mail.deliver! logger.debug "Files were emailed to #{mail.to}" else logger.debug "Files would have been emailed to #{mail.to}, but #{self.class.name} is configured not to" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deliver!(mail)\n delivery_method.deliver!(mail)\n end", "def mail(headers, &hash)\n return if Rails.env.test? && !ActionMailer::Base.perform_deliveries\n super\n end", "def mail(headers={}, &block)\n # TODO: always send to support@bountysource.com and feedback@bountysource.com\n # TODO: never send to qa+?@bountysource.com or null-#@bountysource.com\n\n # doesn't actually do anything, sorry!\n faux_mailer = OpenStruct.new(deliver: nil)\n\n if @unsubscribe_category\n # check if they unsubscribed? (checks person, linked_accounts, emails, etc).\n categories = ['all', @unsubscribe_category]\n categories << 'bounty_alerts' if @unsubscribe_category['bounty_alerts']\n categories << 'team_updates' if @unsubscribe_category['team_updates']\n return faux_mailer if Unsubscribe.d?(headers[:to], categories)\n\n url = \"#{Api::Application.config.www_url}notifications/unsubscribe\"\n params = {\n email: @unsubscribe_token,\n type: @unsubscribe_category\n }\n @unsubscribe_link = \"#{url}?#{params.to_param}\"\n end\n\n # add a prefix to the email in dev/qa mode\n headers[:subject] = \"[#{ENV['SMTP_SUBJECT_PREFIX']}] #{headers[:subject]}\" unless ENV['SMTP_SUBJECT_PREFIX'].blank?\n\n # do we really send an email?\n if ENV['SMTP_WHITELIST'].blank? || ENV['SMTP_WHITELIST'].split(',').include?(headers[:to])\n super headers, &block\n else\n Rails.logger.debug \"MOCK EMAIL: #{headers[:to]} -- #{headers[:subject]}\"\n return faux_mailer\n end\n end", "def deliver!(mail)\n # check validity\n check_delivery_params(mail)\n validate!(mail)\n\n create_factory()\n\n persist_email(mail)\n\n chain_delivery(mail)\n end", "def deliver_email(mail)\n if mail.respond_to?(:deliver_later)\n mail.deliver_later\n else\n mail.deliver\n end\n end", "def attempt_delivery\n send(EmailProxy.provider)\n end", "def mail_should_not_be_sent\n email = ActionMailer::Base.deliveries.pop\n expect(email.present?).to be false\nend", "def test_should_deliver\n SimpleMailer.deliver_test\n assert SimpleMailer.deliveries.size > 0\n end", "def receive(mail)\n mail\n end", "def deliver\n inform_interceptors\n if delivery_handler\n delivery_handler.deliver_mail(self) { do_delivery }\n else\n do_delivery\n end\n inform_observers\n self\n end", "def send_message(email, sender, *to_addrs)\n MockData[:email], MockData[:sender], MockData[:receivers] = email, sender, to_addrs\n end", "def test_mailsystem(switcher = :junk)\n logger.info \"Settings before: #{ActionMailer::Base.smtp_settings.inspect}\"\n \n user = User.find(3)\n case switcher\n when :junk\n setup_email_admin(user)\n @from = head_encode(\"\\\"Kroogi (No Reply)\\\"\".t) + \" <welcome@kroogi.com>\"\n ActionMailer::Base.smtp_settings = APP_CONFIG[:junk_mail]\n when :important\n setup_email(user)\n when :admin\n setup_email_admin(user)\n when :server\n setup_email_admin(user)\n @from = \"Message from Server <engineering@your-net-works.com>\"\n ActionMailer::Base.smtp_settings = APP_CONFIG[:server_mail]\n end\n @recipients = \"engineering@your-net-works.com\"\n @subject += head_encode(\"Email test\".t)\n @body[:info] = ActionMailer::Base.smtp_settings[:user_name]\n \n logger.info \"Settings after: #{ActionMailer::Base.smtp_settings.inspect}\"\n \n end", "def expect_email_to(expected_whom)\n email = ActionMailer::Base.deliveries.last\n expect(email.to[0]).to eq(expected_whom)\n expect(email.subject).to match(TEST_SUBJECT)\n end", "def test_deliver_receipt\n # Setup the mailer.\n ActionMailer::Base.delivery_method = :test\n ActionMailer::Base.perform_deliveries = true\n ActionMailer::Base.deliveries = []\n initial_mbox_length = ActionMailer::Base.deliveries.length\n\n # Get any order.\n @order.deliver_receipt \n\n # We should have received a mail about that.\n assert_equal ActionMailer::Base.deliveries.length, initial_mbox_length + 1\n \n receipt_content = ContentNode.find(:first, :conditions => [\"name = ?\", 'OrderReceipt'])\n \n # Create a block that guarantees that the content node name will be recovered.\n begin\n assert receipt_content.update_attributes(:name => 'order_receipt')\n\n @order.deliver_receipt \n\n # We should NOT have received a mail about that.\n assert_equal ActionMailer::Base.deliveries.length, initial_mbox_length + 1\n ensure\n # Put the name back.\n assert receipt_content.update_attributes(:name => 'OrderReceipt')\n end\n end", "def receive_inbound_email_from_fixture(*args); end", "def receive_inbound_email_from_fixture(*args); end", "def after_deliver; end", "def sends_notification_email(recipient)\n last_email = ActionMailer::Base.deliveries.last\n expect(last_email.to).to include(recipient.email) if last_email\nend", "def test_reset_password\n initial_mbox_length = ActionMailer::Base.deliveries.length\n\n # Get an user to reset the password. \n an_order_user = order_users(:santa)\n \n response_mail = OrdersMailer.create_reset_password(an_order_user)\n\n assert_equal response_mail.subject, \"Password reset for #{Preference.find_by_name('store_name').value}\"\n assert_match /Your password has been reset/, response_mail.body\n assert_equal response_mail.to.to_a, [an_order_user.email_address]\n\n # We should have received a mail about that, except we used create_reset_password instead of deliver_reset_password, above\n # assert_equal ActionMailer::Base.deliveries.length, initial_mbox_length + 1\n end", "def test(email)\n mail(to: email, subject: \"Test\")\n end", "def order_received\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def assert_email_sent(mail_attributes, options={})\n mail_message = Mail::TestMailer.deliveries.last\n raise \"No mail message has been sent!\" unless mail_message.present?\n smtp_settings = options.delete(:smtp) || mail_attributes.delete(:smtp)\n delivery_attributes = mail_attributes\n delivery_attributes = { :to => Array(mail_attributes[:to]), :from => Array(mail_attributes[:from]) }\n delivery_attributes.each_pair do |k, v|\n unless mail_message.method(k).call == v\n raise \"Mail failure (#{k}): #{mail_message.attributes.inspect} does not match #{delivery_attributes.inspect}\"\n end\n end\n Mail::TestMailer.deliveries.clear\n end", "def mail; end", "def setup_delivery\n method = @config.delivery['method'] || :smtp\n options = @config.delivery['options'] || {}\n\n options.keys.each do |key|\n options[(key.to_sym rescue key) || key] = options.delete(key)\n end\n\n options = Idid::Configuration::SMTP_DEFAULTS.merge options if method == :smtp\n options = Idid::Configuration::EXIM_DEFAULTS.merge options if method == :exim\n\n mail_defaults_for method, options\n end", "def test_notify_on_difference\r\n\r\n assert Mailer.deliver_message(:recipients => \"abc@ncsu.edu\",\r\n :subject => \"Expertiza Notification\",\r\n :body => \"abc\")\r\n end", "def order_shipped\n@greeting = \"Hi\"\nmail :to => \"to@example.org\"\nend", "def mailboxer_email(object)\n shouldSendEmail = true\n email if shouldSendEmail\n end", "def test_email(from, to, &block)\n if (block_given?)\n self.class.warn_about_arguments(block, 1..2)\n end\n\n message = {\n from: from,\n to: to,\n test: true,\n callback: block\n }\n\n @messages << message\n\n # If the connection is ready to send...\n if (@interpreter and @interpreter.state == :ready)\n # ...send the message right away.\n after_ready\n end\n end", "def teardown\n ActionMailer::Base.deliveries.clear\n end", "def deliver\n Mail.new(from: from, to: formatted_to, body: sanitized_message).deliver!\n end", "def test_email_client_secondary_success_only\n MailgunClient.stubs(:send_email).returns(bad_req_code)\n SendgridClient.stubs(:send_email).returns(ok_code)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n response.set_ok\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def assert_email_sent(mail_attributes, options={})\n mail_message = Mail::TestMailer.deliveries.last\n raise \"No mail message has been sent!\" unless mail_message.present?\n delivery_attributes = mail_attributes\n delivery_attributes = { :to => Array(mail_attributes[:to]), :from => Array(mail_attributes[:from]) }\n delivery_attributes.each_pair do |k, v|\n unless mail_message.method(k).call == v\n raise \"Mail failure (#{k}): #{mail_message.attributes.inspect} does not match #{delivery_attributes.inspect}\"\n end\n end\n Mail::TestMailer.deliveries.clear\n end", "def test(recipient)\n mail(to: recipient, subject: \"#{subject_prefix} Hello from Book Tracker\")\n end", "def deliver!\n self.do_deliver\n end", "def setup\n ActionMailer::Base.delivery_method = :test\n ActionMailer::Base.perform_deliveries = true\n ActionMailer::Base.deliveries = []\n end", "def test_email_client_handles_unsuported_input\n MailgunClient.stubs(:send_email).returns(ok_code)\n SendgridClient.stubs(:send_email).returns(ok_code)\n\n assert_equal ClientResponse.new, EmailClient.send_email(nil)\n assert_equal ClientResponse.new, EmailClient.send_email('')\n assert_equal ClientResponse.new, EmailClient.send_email(123)\n assert_equal ClientResponse.new, EmailClient.send_email({})\n assert_equal ClientResponse.new, EmailClient.send_email([])\n end", "def mock_successful_send(from, message, options={})\n options = {:color => 'yellow', :notify => 0, :message_format => 'html'}.merge(options)\n stub_request(:post, \"https://api.hipchat.com/v1/rooms/message\").with(\n :query => {:auth_token => \"blah\"},\n :body => {:room_id => \"Hipchat\",\n :from => \"Dude\",\n :message => \"Hello world\",\n :message_format => options[:message_format],\n :color => options[:color],\n :notify => \"#{options[:notify]}\"},\n :headers => {'Accept' => 'application/json',\n 'Content-Type' => 'application/x-www-form-urlencoded'}).to_return(:status => 200, :body => \"\", :headers => {})\n\n end", "def deliver!(mail = @mail)\n raise \"no mail object available for delivery!\" unless mail\n unless logger.nil?\n logger.info \"Sent mail to #{Array(recipients).join(', ')}\"\n logger.debug \"\\n#{mail.encoded}\"\n end\n\n begin\n __send__(\"perform_delivery_#{delivery_method}\", mail) if perform_deliveries\n rescue Exception => e # Net::SMTP errors or sendmail pipe errors\n logger.error \"#{delivery_method} delivery Error! #{e.message}\" unless logger.nil?\n raise e if raise_delivery_errors || ALWAYS_RAISE_ACTIONS.include?(self.action_name)\n end\n return mail\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def test_deliver_failed\n # Setup the mailer.\n ActionMailer::Base.delivery_method = :test\n ActionMailer::Base.perform_deliveries = true\n ActionMailer::Base.deliveries = []\n initial_mbox_length = ActionMailer::Base.deliveries.length\n\n @order.deliver_failed \n\n # We should have received a mail about that.\n assert_equal ActionMailer::Base.deliveries.length, initial_mbox_length + 1\n end", "def test_email_client_all_clients_bad_request\n MailgunClient.stubs(:send_email).returns(bad_req_code)\n SendgridClient.stubs(:send_email).returns(bad_req_code)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n response.set_bad_req\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def mail_should_be_sent(*text, path: nil, to: nil)\n # Check up to 5 times if email has been sent, in case test runs too fast\n email = nil\n email_sent = false\n (1..5).each do\n email = ActionMailer::Base.deliveries.pop\n email_sent = email.present?\n break if email_sent\n sleep 1\n end\n\n expect(email_sent).to be true\n\n if to.present?\n expect(email.to.first).to eq to\n end\n\n href = nil\n # Test each part of a multipart email.\n if email.multipart?\n # A link to \"path\" must be found in at least one of the email parts\n if path.present?\n link_found = false\n email.parts.each do |part|\n partBody = Nokogiri::HTML part.body.to_s\n link = partBody.at_css \"a[href*=\\\"#{path}\\\"]\"\n if link.present?\n link_found = true\n href = link[:href]\n end\n end\n expect(link_found).to be true\n end\n\n # Each string passed in \"text\" must be found in at least one of the email parts\n if text.size > 0\n text.each do |t|\n text_found = false\n email.parts.each do |part|\n body_s = part.body.to_s\n if body_s.include? t\n text_found = true\n end\n end\n expect(text_found).to be true\n end\n end\n else\n if path.present?\n emailBody = Nokogiri::HTML email.body.to_s\n link = emailBody.at_css \"a[href*=\\\"#{path}\\\"]\"\n expect(link.present?).to be true\n href = link[:href]\n end\n\n if text.size > 0\n body_s = email.body.to_s\n text.each {|t| expect(body_s.include? t).to be true}\n end\n end\n\n return href\nend", "def chain_delivery(mail)\n if @chain_delivery_method && @chain_filter.call(mail)\n mail.delivery_method(\n @chain_delivery_method,\n ActionMailer::Base.send(\"#{@chain_delivery_method}_settings\")\n )\n mail.deliver\n end\n end", "def test_email_client_empty_input\n MailgunClient.stubs(:send_email).returns(ok_code)\n SendgridClient.stubs(:send_email).returns(ok_code)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n response.set_ok\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def deliver_mail\n @invitation.deliver_mail\n track 'Invitation Deliver Mail', @invitation\n redirect_to account_invitations_path, notice: 'Invitation email has been sent.'\n end", "def deliver!(mail)\n # construct message object with text and html parts\n message = {\n subject: mail.subject,\n from_email: mail.from.first,\n from_name: mail[:from].display_names.first,\n to: [\n {\n email: mail.to.first,\n name: mail[:to].display_names.first\n }\n ],\n text: mail.text_part.body.raw_source,\n html: mail.html_part.body.raw_source\n }\n\n # send via mandrill API\n Rails.configuration.mandrill_mailer.messages.send(message)\n end", "def notify\n @greeting = \"Just a test\"\n mail(to: \"cneumann@marsmonitoring.com\") #.deliver_later\n end", "def deliver!(mail)\n parameters = settings.dup\n parameters.delete(:return_response)\n message = MultiMail::Message::SendGrid.new(mail).to_sendgrid_hash.merge(parameters)\n\n connection = Faraday.new do |conn|\n conn.request :multipart\n conn.request :url_encoded\n conn.adapter Faraday.default_adapter\n end\n\n response = connection.post('https://sendgrid.com/api/mail.send.json', message)\n\n body = JSON.load(response.body)\n\n unless response.status == 200\n if body['message'] == 'error'\n case body['errors']\n when ['Bad username / password']\n raise InvalidAPIKey, body['errors'].first\n when ['Empty from email address (required)']\n raise MissingSender, body['errors'].first\n when ['Missing destination email']\n raise MissingRecipients, body['errors'].first\n when ['Missing subject']\n raise MissingSubject, body['errors'].first\n when ['Missing email body']\n raise MissingBody, body['errors'].first\n else\n raise body['errors'].join\n end\n else\n raise body['errors'].join\n end\n end\n\n if settings[:return_response]\n body\n else\n self\n end\n end", "def do_not_deliver!\n def self.deliver! ; false ; end\n end", "def do_not_deliver!\n def self.deliver! ; false ; end\n end", "def do_not_deliver!\n def self.deliver! ; false ; end\n end", "def test_email_should_be_sent_for_comment_added\n comment = comments(:generic_comment)\n @recipient.update_attributes! :email => \"test@example.com\", :password => \"my_pass\", :password_confirmation => \"my_pass\"\n comment.send_message(:to => [@recipient], :mailer_method => :comment_added)\n # Assume that the last delivery will be the one.\n email = ActionMailer::Base.deliveries.last\n assert_match email.subject, \"Demo: New comment on presentation #{comment.presentation.number}\"\n assert_match email.encoded, /#{comment.text}/ \n end", "def deliver!(mail)\n message = MultiMail::Message::Mandrill.new(mail).to_mandrill_hash.merge(parameters)\n\n response = Faraday.post('https://mandrillapp.com/api/1.0/messages/send.json', JSON.dump({\n :key => api_key,\n :message => message,\n :async => async,\n :ip_pool => ip_pool,\n :send_at => send_at,\n }))\n\n body = JSON.load(response.body)\n\n unless response.status == 200\n if body['status'] == 'error'\n case body['name']\n when 'Invalid_Key'\n raise InvalidAPIKey, body['message']\n else\n raise body['message']\n end\n else\n raise body['message']\n end\n end\n\n if settings[:return_response]\n body\n else\n self\n end\n end", "def test_email_client_primary_success_only\n MailgunClient.stubs(:send_email).returns(ok_code)\n SendgridClient.stubs(:send_email).returns(bad_req_code)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n response.set_ok\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def verify_email\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def verify_email\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def reserved_mail\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def test_email_client_all_clients_success\n MailgunClient.stubs(:send_email).returns(ok_code)\n SendgridClient.stubs(:send_email).returns(ok_code)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n response.set_ok\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def test_email_client_all_clients_undefined_code\n MailgunClient.stubs(:send_email).returns(100)\n SendgridClient.stubs(:send_email).returns(100)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def mock_successful_send(from, message, options={})\n options = {:color => 'yellow', :notify => false, :message_format => 'html'}.merge(options)\n stub_request(:post, \"https://api.hipchat.com/v2/room/Hipchat/notification\").with(\n :query => {:auth_token => \"blah\"},\n :body => {:room_id => \"Hipchat\",\n :from => \"Dude\",\n :message => \"Hello world\",\n :message_format => options[:message_format],\n :color => options[:color],\n :notify => options[:notify]}.to_json,\n :headers => {'Accept' => 'application/json',\n 'Content-Type' => 'application/json'}).to_return(:status => 200, :body => \"\", :headers => {})\n end", "def test\n @greeting = \"Hi\"\n\n mail(to: \"louis.fourrier@gmail.com\", subject: 'Welcome to the test suite of mail market')\n end", "def run_mail_test(name, user = nil)\n text_files = Dir.glob(\"#{FIXTURES_PATH}/#{name}.text*\").\n reject { |x| x.end_with?(\".new\") }\n html_files = Dir.glob(\"#{FIXTURES_PATH}/#{name}.html*\").\n reject { |x| x.end_with?(\".new\") }\n\n assert(text_files.any? || html_files.any?)\n\n if text_files.any?\n user.email_html = false if user\n yield\n email = ActionMailer::Base.deliveries.last.encoded\n email = remove_extraneous_email_headers(email)\n assert_string_equal_file(email, *text_files)\n end\n\n return unless html_files.any?\n\n user.email_html = true if user\n yield\n email = ActionMailer::Base.deliveries.last.encoded\n email = remove_extraneous_email_headers(email)\n fix_mac_vs_pc!(email)\n assert_string_equal_file(email, *html_files)\n end", "def mailer; end", "def send_mail(mail_from, mail_to, mail_subject, mail_attachment = nil, type = nil, mail_body = nil)\n begin\n attached_file = ''\n if !mail_attachment.nil?\n LoggerHelper.log_debug('rqa.log', 'Absolute path to attachment: ' + mail_attachment, __FILE__, __LINE__)\n\n ext = ApplicationHelper.get_rqa_config('attachment_extension')\n LoggerHelper.log_debug('rqa.log', 'Attachment extension in config: ' + ext, __FILE__, __LINE__)\n\n attached_file = File.basename(mail_attachment).gsub('.zip', '.' + ext)\n LoggerHelper.log_debug('rqa.log', 'Attachment file: ' + attached_file, __FILE__, __LINE__)\n\n attachments.inline[attached_file] = File.read(mail_attachment, mode: 'rb')\n LoggerHelper.log_info('rqa.log', 'Read attachment: done.', __FILE__, __LINE__)\n end\n if !type.nil?\n header = '{\"COMPANY\": \"WALLEM\", \"APPLICATION\": \"TPS RQA\", \"TYPE\": \"'\n header += type.to_s.upcase\n header += '\", \"VERSION\": \"<TBD>\", \"COMMENT\": \"<TBD>\"}'\n LoggerHelper.log_debug('rqa.log', 'HEADER: ' + header, __FILE__, __LINE__)\n\n headers['X-CUSTOM'] = header\n LoggerHelper.log_info('rqa.log', 'Write custom header: done.', __FILE__, __LINE__)\n end\n\n LoggerHelper.log_debug('rqa.log', 'Sent mail. FROM: ' + mail_from, __FILE__, __LINE__)\n LoggerHelper.log_debug('rqa.log', 'Sent mail. TO: ' + mail_to, __FILE__, __LINE__)\n LoggerHelper.log_debug('rqa.log', 'Sent mail. SUBJECT: ' + mail_subject, __FILE__, __LINE__)\n LoggerHelper.log_debug('rqa.log', 'Sent mail. ATTACHMENT: ' + attached_file, __FILE__, __LINE__)\n\n if mail_body.nil?\n LoggerHelper.log_info('rqa.log', 'Body is null => using body template.', __FILE__, __LINE__)\n mail(from: mail_from, to: mail_to, subject: mail_subject).deliver!\n else\n mail(from: mail_from, to: mail_to, subject: mail_subject, body: mail_body).deliver!\n end\n LoggerHelper.log_info('rqa.log', 'Sent mail: done and successfully.', __FILE__, __LINE__)\n rescue => ex\n LoggerHelper.log_error('rqa.log', ex.message, __FILE__, __LINE__)\n LoggerHelper.log_error('rqa.log', ex.backtrace.join(\"\\n\").to_s, __FILE__, __LINE__)\n return false\n end\n return true\n end", "def do_smtp(mail_account)\n\n recipients = []\n\n if self.to_addresses.nil? or self.to_addresses.empty?\n email_to = nil\n else\n email_to = self.get_to_addresses\n recipients.concat(email_to)\n email_to.map! { |addr|\n EmailsHelper.encode_disp_name(addr)\n }\n end\n if self.cc_addresses.nil? or self.cc_addresses.empty?\n email_cc = nil\n else\n email_cc = self.get_cc_addresses\n recipients.concat(email_cc)\n email_cc.map! { |addr|\n EmailsHelper.encode_disp_name(addr)\n }\n end\n if self.bcc_addresses.nil? or self.bcc_addresses.empty?\n email_bcc = nil\n else\n email_bcc = self.get_bcc_addresses\n recipients.concat(email_bcc)\n end\n\n sender = self.from_address\n email_from = EmailsHelper.encode_disp_name(sender)\n\n if !self.reply_to.nil? and !self.reply_to.empty?\n reply_to = self.reply_to\n elsif !mail_account.reply_to.nil? and !mail_account.reply_to.empty?\n reply_to = EmailsHelper.encode_disp_name(mail_account.reply_to)\n else\n reply_to = nil\n end\n\n if mail_account.organization.nil? or mail_account.organization.empty?\n organization = nil\n else\n organization = EmailsHelper.encode_b(mail_account.organization)\n end\n\n has_attach = !(self.mail_attachments.nil? or self.mail_attachments.empty?)\n boundary = Digest::SHA1.hexdigest(Time.now.to_f.to_s)\n\n email_content = ''\n email_content << \"From: #{email_from}\\n\"\n unless email_to.nil?\n email_content << \"To: #{email_to.join(\",\\n \")}\\n\"\n end\n unless email_cc.nil?\n email_content << \"Cc: #{email_cc.join(\",\\n \")}\\n\"\n end\n unless reply_to.nil?\n email_content << \"Reply-To: #{reply_to}\\n\"\n end\n unless organization.nil?\n email_content << \"Organization: #{organization}\\n\"\n end\n email_content << \"Subject: #{EmailsHelper.encode_b(self.subject)}\\n\"\n email_content << \"Date: #{Time::now.strftime('%a, %d %b %Y %X %z')}\\n\"\n email_content << \"Mime-Version: 1.0\\n\"\n email_content << \"User-Agent: Thetis\\n\"\n if has_attach\n email_content << \"Content-Type: multipart/mixed; boundary=#{boundary}\\n\"\n email_content << \"\\n\"\n email_content << \"--#{boundary}\\n\"\n end\n email_content << \"Content-Type: text/plain; charset=utf-8\\n\"\n email_content << \"Content-Transfer-Encoding: base64\\n\"\n email_content << \"\\n\"\n email_content << \"#{[self.message].pack('m')}\\n\"\n=begin\n email_content << <<EOT\n#{Base64::encode64(self.message).scan(/.{1,60}/).join(\"\\n\")}\nEOT\n=end\n\n# logger.fatal email_content\n\n if has_attach\n email_content << \"\\n\"\n self.mail_attachments.each do |mail_attach|\n attach_name = EmailsHelper.encode_b(mail_attach.name)\n\n attach_content = File.open(mail_attach.get_path).readlines.join('')\n\n email_content << \"--#{boundary}\\n\"\n email_content << \"Content-Type: application/octet-stream;\\n\"\n email_content << \" name=\\\"#{attach_name}\\\"\\n\"\n email_content << \"Content-Disposition: attachment;\\n\"\n email_content << \" filename=\\\"#{attach_name}\\\"\\n\"\n email_content << \"Content-Transfer-Encoding: base64\\n\"\n email_content << \"\\n\"\n email_content << \"#{[attach_content].pack('m')}\\n\"\n end\n email_content << \"--#{boundary}--\\n\"\n end\n\n # Do SMTP\n smtp = Net::SMTP.new(mail_account.smtp_server, mail_account.smtp_port)\n\n case mail_account.smtp_secure_conn\n when MailAccount::SMTP_SECURE_CONN_STARTTLS\n context = Net::SMTP.default_ssl_context\n context.verify_mode = OpenSSL::SSL::VERIFY_NONE\n smtp.enable_starttls(context)\n # smtp.enable_starttls_auto \n\n when MailAccount::SMTP_SECURE_CONN_SSL_TLS\n smtp.enable_ssl(OpenSSL::SSL::VERIFY_NONE)\n end\n\n if mail_account.smtp_auth\n smtp.start('localhost.localdomain', mail_account.smtp_username, mail_account.smtp_password, mail_account.smtp_auth_method) do |_smtp|\n _smtp.sendmail(email_content, sender, recipients.uniq)\n end\n else\n smtp.start do |_smtp|\n _smtp.sendmail(email_content, sender, recipients.uniq)\n end\n end\n\n begin\n self.save_raw(email_content)\n rescue => evar\n Log.add_error(nil, evar)\n end\n end", "def order_in_progress\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def test_mail(to)\n subject 'pol test mail'\n recipients to\n from MAIL_RECIPIENT\n part \"text/plain\" do |p|\n p.body = 'pol ist tol.'\n end\n end", "def perform(mailer, method, *args)\n mailer.send(method, *args).deliver\n #ex: LadybooMailer.atm_checkout_completed_successfully(order).deliver\n end", "def deliver\n Mailer.deliver_message(options)\n end", "def test_email_should_be_sent_for_presentation_modified\n presentation = presentations(:generic_presentation)\n @recipient.update_attributes! :email => \"test@example.com\", :password => \"my_pass\", :password_confirmation => \"my_pass\"\n presentation.send_message(:to => [@recipient], :mailer_method => :presentation_modified)\n # Assume that the last delivery will be the one.\n email = ActionMailer::Base.deliveries.last\n assert_match email.subject, \"Demo: Presentation #{presentation.number} modified\"\n assert_match email.encoded, /Presentation #{presentation.number} was modified/ \n end", "def order_received(order)\n@order=order\nmail(:to => order.email, :subject => 'Pragmatic Toy Shop Order Confirmation')\nend", "def test_creation_and_delivery\n @expected.to = 'trejkaz@trypticon.org/tests'\n\n # Test creation of the message.\n assert_equal [ @expected ], SimpleMessenger.create_wakeup('trejkaz@trypticon.org/tests')\n \n # Test delivery.\n SimpleMessenger.send_wakeup('trejkaz@trypticon.org/tests')\n assert_equal [ @expected ], @messenger.deliveries\n end", "def test_scheduled_email(recipient)\n @fullname = recipient.fullname\n @email = recipient.email\n @password = recipient.password\n @company_name = \"A&S Designs\"\n @support_email = \"support@codingsherpa.com\"\n @url = \"http://zdesign.codingsherpa.com\"\n \n logger.info \"AppLog: test_Scheudled_email \" + recipient.fullname\n \n mail(:to => recipient.email,\n :subject => \"Scheduled email from \" + @company_name + \"!\")\n end", "def received(order)\n @order = order\n mail to: order.email, subject: 'Подтверждение заказа в Card Shop'\nend", "def deliver!(mail = @mail)\n set_language_if_valid @initial_language\n return false if (recipients.nil? || recipients.empty?) &&\n (cc.nil? || cc.empty?) &&\n (bcc.nil? || bcc.empty?)\n \n # Set Message-Id and References\n if @message_id_object\n mail.message_id = self.class.message_id_for(@message_id_object)\n end\n if @references_objects\n mail.references = @references_objects.collect {|o| self.class.message_id_for(o)}\n end\n \n # Log errors when raise_delivery_errors is set to false, Rails does not\n raise_errors = self.class.raise_delivery_errors\n self.class.raise_delivery_errors = true\n begin\n return super(mail)\n rescue Exception => e\n if raise_errors\n raise e\n elsif mylogger\n mylogger.error \"The following error occured while sending email notification: \\\"#{e.message}\\\". Check your configuration in config/email.yml.\"\n end\n ensure\n self.class.raise_delivery_errors = raise_errors\n end\n end", "def deliver_email\n error = \"We forgot to define #{type}#deliver_email.\\n\"\n # Failing to send email should not throw an error in production\n return warn(error) if Rails.env.production?\n\n raise(error)\n end", "def deliver!(mail)\n attributes = email_attributes(mail)\n mail.destinations.each do |destination|\n ArMailerRevised.email_class.create!(attributes.merge({:to => destination}))\n end\n end", "def test_emails\n end", "def stub_get(path, filename, options={})\n opts = {:body => fixture_file(filename)}.merge(options)\n\n FakeWeb.register_uri(:get, dinero_mail_url(path), opts)\nend", "def do_reply(subject, msg)\n full_msg=<<END_OF_MESSAGE\nFrom: #{@test_data['user_name']}\nTo: #{@test_data['reply_email']}\nSubject: #{subject}\nDate: #{Time.now}\n\n#{msg}\nEND_OF_MESSAGE\n Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)\n Net::SMTP.start(@test_data['smtp_host'], @test_data['smtp_port'], @test_data['mail_domain'], @test_data['user_name'], @test_data['user_passwd'], :login) { |smtp|\n smtp.send_message(full_msg, @test_data['user_name'], @test_data['reply_email'])\n }\nend", "def request_mail(from_email, content_body, requestor_type)\n @content= content_body\n @sender = from_email\n @requestor_type = requestor_type\n mail from: from_email, to: 'contact@codemalaysia.com', subject: 'PFS general enquiry'\n end", "def test_failed\n initial_mbox_length = ActionMailer::Base.deliveries.length\n # Get any order.\n an_order = orders(:santa_next_christmas_order)\n \n # Create a standard failure response when cc number is wrong. Parameters: success, message, params = {}, options = {}\n a_negative_response = ActiveMerchant::Billing::Response.new(\n false,\n \"(TESTMODE) The credit card number is invalid\",\n {\n :response_reason_text => \"(TESTMODE) The credit card number is invalid.\",\n :response_reason_code => \"6\",\n :response_code => \"3\",\n :avs_message => \"Address verification not applicable for this transaction\",\n :transaction_id => \"0\",\n :avs_result_code => \"P\",\n :card_code => nil\n }, {\n :test => true,\n :authorization => \"0\",\n :fraud_review => false\n }\n )\n \n # Stub the purchase method to not call home (using commit) and return a standard failure response.\n ActiveMerchant::Billing::AuthorizeNetGateway.any_instance.stubs(:purchase).returns(a_negative_response)\n\n # Assert that with a failure response the method will return the response message.\n assert_equal an_order.run_transaction_authorize, a_negative_response.message \n assert_equal ActionMailer::Base.deliveries.length, initial_mbox_length + 1\n \n response_mail = ActionMailer::Base.deliveries.first\n \n assert_equal response_mail.subject, 'An order has failed on the site'\n assert_match /Order #: #{an_order.order_number}/, response_mail.body\n assert_equal response_mail.to.to_a, Preference.find_by_name('mail_copy_to').value.split(',')\n \n end", "def send_email\n # There is a deliver_later method which we could use\n InvoiceMailer.email_invoice(self).deliver_now\n self.sent_by_email = true\n self.save\n end", "def purchase_email\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def send_test\n @greeting = \"Hi\"\n\n mail to: \"ronibelson@gmail.com\",\n subject: \"hi ron\",\n from: \"ronbelson@gmail.com\"\n end", "def method_missing(method, *args, &block)\n if instance_methods.include?(method)\n mailer = new\n mailer.send(method, *args, &block)\n mailer\n else\n super\n end\n end", "def setup_mail(action, options = {})\n headers = options.fetch(:headers, {})\n headers[:subject] ||= choose_subject(options.fetch(:subject_ab_test_key, action), options.fetch(:params, {}))\n fire_user_notification_event(:email, {type: \"#{mailer_name}##{action}\", to: headers[:to]})\n mail(headers)\n end", "def test_email_client_all_clients_internal_error\n MailgunClient.stubs(:send_email).returns(internal_err_code)\n SendgridClient.stubs(:send_email).returns(internal_err_code)\n\n input_val = EmailObject.new\n response = ClientResponse.new input_val\n response.set_internal_err\n\n assert_equal response, EmailClient.send_email(input_val)\n end", "def receive_inbound_email_from_mail(**kwargs, &block); end", "def test(recipient)\n subject 'This is a test mail for you.'\n recipients recipient\n from 'Project Bordeaux No-Reply <no-reply@appfactory.us>'\n sent_on Time.now\n body :email => recipient, :url => FB_APP_HOME_URL\n end", "def send_reminder_email \n UserMailer.reminder_email(self).deliver\n end", "def simple_test\n @greeting = \"Hi\"\n\n mail to: '\"Yuichi Takeuchi\" <uzuki05@takeyu-web.com>'\n end", "def send_email(object)\n # SomeNotifier.notification(...).deliver_now\n end", "def send_test_email\n @email = \"hanks@pobox.com\"\n RegistrationMailer.test(@email)\n end", "def receive_inbound_email_from_fixture(*args)\n create_inbound_email_from_fixture(*args).tap(&:route)\n end", "def mock_exchange(opts={})\n MockExchange.new(opts)\n end", "def deliver_failed\n OrdersMailer.deliver_failed(self)\n end" ]
[ "0.6902263", "0.6689212", "0.668046", "0.6551013", "0.6544629", "0.6540586", "0.6504109", "0.6487756", "0.6424335", "0.64029855", "0.6301557", "0.63013154", "0.62775016", "0.6270943", "0.6267072", "0.6267072", "0.625257", "0.62435454", "0.622653", "0.62154555", "0.62098426", "0.62081105", "0.61871356", "0.6171994", "0.6167067", "0.6146105", "0.6135551", "0.61329263", "0.61103237", "0.61073434", "0.60858965", "0.60750574", "0.60563666", "0.60489684", "0.6044915", "0.60415995", "0.6023429", "0.6020959", "0.60150635", "0.60150635", "0.60150635", "0.60150635", "0.5987912", "0.59767973", "0.5976793", "0.59664243", "0.59631777", "0.59589666", "0.5947796", "0.59476036", "0.59438056", "0.59327525", "0.59327525", "0.59327525", "0.5925672", "0.5922854", "0.59205514", "0.59130925", "0.59130925", "0.5903776", "0.5902917", "0.58861357", "0.5882833", "0.58763796", "0.5868466", "0.5860115", "0.5853087", "0.58478904", "0.5833572", "0.5821224", "0.5819472", "0.581429", "0.5805773", "0.5791266", "0.5786799", "0.5782946", "0.57810503", "0.57751966", "0.57751137", "0.5773551", "0.57725114", "0.5767", "0.5765934", "0.57586604", "0.57533294", "0.5750521", "0.5748375", "0.5741939", "0.5739022", "0.57377577", "0.5737314", "0.5732777", "0.57280105", "0.5724831", "0.57222396", "0.57179683", "0.5715532", "0.56945634", "0.5690197", "0.5689802" ]
0.61922216
22
Opens and reads a file, first given the filename, then tries from the project base directory
def read_file filename f = filename unless File.exist? f f = Pathname.new(__FILE__).realpath.parent.parent.parent + f end File.read f end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file(filename) File.read(File.absolute_path(filename, File.dirname($PROGRAM_NAME))) end", "def load_file( filename )\n begin\n read_in = File.new( filename, 'r' )\n rescue\n abort \"\\\"#{ filename }\\\" not found\"\n end\nend", "def open_file(filename)\n File.open(filename, 'r')\n end", "def readfile(filename)\n\tfilename = File.expand_path(filename, File.dirname(__FILE__))\n\tFile.read(filename)\nrescue\n\tnil\nend", "def read_relative_file(name, from=__FILE__)\n File.read(File.join(File.dirname(from), name))\n end", "def from_file path\n run File.read(path) if File.exists? path\n end", "def read_file(filename); end", "def read_file(absolute_path); end", "def open_file f\n return unless f\n unless File.exist? f\n # this happens if we use (T) in place of (M) \n # it places a space after normal files and @ and * which borks commands\n last = f[-1]\n if last == \" \" || last == \"@\" || last == '*'\n f = f.chop\n end\n end\n if File.directory? f\n change_dir f\n elsif File.readable? f\n system(\"$EDITOR #{Shellwords.escape(f)}\")\n f = Dir.pwd + \"/\" + f if f[0] != '/'\n $visited_files.insert(0, f)\n push_used_dirs Dir.pwd\n else\n perror \"open_file: (#{f}) not found\"\n # could check home dir or CDPATH env variable DO\n end\nend", "def find(filename)\n find_location filename do |file|\n return File.new file\n end\n end", "def find filename\n return filename if File.exists? filename\n filename = \"./haml/\"+filename\n return filename if File.exists? filename\n filename = @src_folder+\"/\"+filename\n return filename if File.exists? filename\n throw \"Could not find file: #{filename}\"\nend", "def read(file)\n filepath = File.join(File.dirname(__dir__), file)\n file = File.read(filepath)\n Success(file)\n rescue\n Failure(\"Failed to parse file\")\n end", "def fetch_site_file(filename=\"Gumdrop\")\n here= Dir.pwd\n found= File.file? here / filename\n # TODO: Should be smarter -- This is a hack for Windows support \"C:\\\"\n while !found and File.directory?(here) and File.dirname(here).length > 3\n here= File.expand_path here /'..'\n found= File.file? here / filename\n end\n if found\n File.expand_path here / filename\n else\n nil\n end\n end", "def try_file(filename)\n return file(filename)\n rescue FileMissing\n return nil\n end", "def try_file(filename)\n return file(filename)\n rescue FileMissing\n return nil\n end", "def read_file(file)\n text_file = (path.ftype == \"directory\" ? path : Pathname.new(path.dirname)) + file\n File.read(text_file) if File.exists?(text_file)\n end", "def get_template_file(filename)\n if File.exists?(filename)\n templateFile = filename\n else\n templateFile = File.expand_path(\"../../#{filename}\", __FILE__)\n end\n\n File.read(templateFile)\nend", "def file_read( file )\n vputs \"Reading '#{ file }'\"\n # I suspect that there are issues reading files with a space in them. I'm having a hard time tracking it down though.. TODO: I should adjust the test case.\n if ! File.exists?( file ) then\n puts \"That file doesn't exist: '#{ file.inspect }'\"\n return\n end\n # TODO: Check permissions, etc.\n# file = file.sub( ' ', '_' )\n f = File.open( file, 'r' )\n string = f.read\n f.close\n return string\nend", "def find_file( filename )\r\n dir = @autoload_dirs.find { |dir|\r\n exist?( File.join(dir,filename) )\r\n }\r\n\r\n if dir\r\n return File.join(dir,filename)\r\n else\r\n return nil\r\n end\r\n end", "def load_from_file filename\n fnm = File.exist?(filename) ? filename : File.join(@wd,filename)\n load_configuration(fnm)\n end", "def loadfile(filename)\n file = nil\n open(filename, 'r') do |f|\n file = f.read\n end\n file\nend", "def read\n File.read(file_name)\n rescue Errno::ENOENT\n # ignore, will return nil\n end", "def read_in_sandbox(filename)\n file = Dir[File.join(sandbox, filename)].first\n file ? File.read(file) : \"\"\nend", "def read(filename)\n if File.exist? File.join(@directory, filename)\n File.open(File.join(@directory, filename)).read()\n # elsif @output_directory && File.exist?(File.join(@output_directory, filename))\n # # elsif @output_directory && File.exist?(File.join(@output_directory, filename))\n # File.open(File.join(@output_directory, filename)).read()\n else\n File.open(filename).read()\n end\n end", "def try_file(opt=\"\")\n File.read(File.expand_path(opt)) rescue opt\n end", "def get_local_file(fname)\n if File.exist?(@dir+'/'+fname) then\n fname = @dir+'/'+fname\n end\n return File.open(fname)\n end", "def try_read_file(name)\n File.read(name).strip\n rescue StandardError\n name\n end", "def try_read_file(name)\n File.read(name).strip\n rescue StandardError\n name\n end", "def _get_file(name)\n File.read(\"%s/%s\" % [uri, name])\n end", "def read_file(file_path)\n raise(format(ERROR_FILE_NOT_EXIST, file_path)) unless File.exist?(file_path)\n\n File.read(file_path)\n end", "def project_file(fname)\n \"#{@project_path}/#{fname}\"\nend", "def file\n File.join(root, FILENAME)\n end", "def open_in_file(filepath)\n File.open(filepath, 'rb')\n end", "def open_file f\n return unless f\n\n f = File.expand_path(f) if f.start_with?(\"~/\")\n unless File.exist? f\n # this happens if we use (T) in place of (M)\n # it places a space after normal files and @ and * which borks commands\n last = f[-1]\n f = f.chop if last == ' ' || last == '@' || last == '*'\n end\n\n # could be a bookmark with position attached to it\n f, _nextpos = f.split(':') if f.index(':')\n if File.directory? f\n save_dir_pos\n change_dir f # , nextpos\n elsif File.readable? f\n comm = opener_for f\n # '%%' will be substituted with the filename. See zip\n comm = if comm.index('%%')\n comm.gsub('%%', Shellwords.escape(f))\n else\n comm + \" #{Shellwords.escape(f)}\"\n end\n clear_screen\n reset_terminal\n system(comm.to_s)\n setup_terminal\n # XXX maybe use absolute_path instead of hardcoding\n f = expand_path(f)\n @visited_files.insert(0, f)\n push_used_dirs @current_dir\n else\n perror \"open_file: (#{f}) not found\"\n # could check home dir or CDPATH env variable DO\n end\n redraw_required\nend", "def [](file_name)\n path = absolute_path_to_file(file_name)\n return nil unless File.exist?(path)\n File.read(path)\n end", "def read_file(basename_or_regex)\n File.read(find_file_path(basename_or_regex))\n end", "def open(filename)\n File.open File.join(extract_path, filename), 'r'\n end", "def base_file\n file = File.join(Dir.getwd, 'api', 'base.rb')\n FileFoo.read_file(file)\n end", "def load_file(filename); end", "def load_file(filename); end", "def load_file(file); end", "def read(file)\n if @options[:input_file]\n file = File.join(File.dirname(@options[:input_file]), file)\n end\n File.read(file)\n end", "def in_file(filename); end", "def read file\n File.open file\n end", "def read_file(filename)\n begin\n document = File.open(filename, 'r')\n document.readlines\n rescue\n puts 'File not found'\n end\nend", "def read_file\n @read_file ||= File.open(self.file)\n end", "def load_resource_relative(path, mode='r')\n\n absolute_path = File.dirname(caller_locations(1,1)[0].path) + '/' + path\n if absolute_path.to_s.chars.first == ':'\n absolute_path = OpenStudio.get_absolute_path(absolute_path)\n end\n\n if EmbeddedScripting::hasFile(absolute_path)\n return EmbeddedScripting::getFileAsString(absolute_path)\n end\n\n result = \"\"\n if File.exists?(absolute_path)\n File.open(absolute_path, mode) do |file|\n result = file.read\n end\n elsif File.exists?(path)\n File.open(path, mode) do |file|\n result = file.read\n end\n end\n return result\n end", "def file_open(direct_name, file_name)\n\t\tif file_name == \"u.data\"\n\t\t\ttrain_name = \"./\" + direct_name + \"/\" + file_name\n\t\t\t@test_file = nil\n\t\telse\n\t\t\t#when file_name is not empty\n\t\t\ttrain_name = \"./\" + direct_name + \"/\" + file_name.to_s + \".base\"\n\t\t\ttest_name = \"./\" + direct_name + \"/\" + file_name.to_s + \".test\"\n\t\t\t@test_file = File.open(test_name)\n\t\tend\n\t\t@train_file = File.open(train_name)\n\tend", "def get_input_file(input_file)\n puts \"-------------- Entering get_input_file() Method\"\n if File.exist?(input_file)\n input_file = File.open(File.join(File.dirname('__FILE__'),input_file),\"r\")\n puts \"Got the input file with read mode\"\n else\n puts \"Please check the input file exists\"\n raise \"Error in reading the input file\"\n end\n\n puts \"--------------- Exiting get_input_file() Method\"\n input_file\nend", "def get_file(name, env)\n name = name + '.rb' unless name =~ /\\.rb$/\n path = search_directories(env).find { |dir| Puppet::FileSystem.exist?(File.join(dir, name)) }\n path and File.join(path, name)\n end", "def read_test_file(file)\n read_file(file)\n end", "def load_file(filename)\n File.read File.join(\"plugins\",name,filename)\n end", "def open_file\n\t\t\tif file_path[-4..-1] == \".bz2\"\n\t\t\t\treturn Bzip2::Reader.open(file_path)\n\t\t\telse\n\t\t\t\treturn File.open(file_path,'r')\n\t\t\tend\n\t\tend", "def file(name)\n if name.start_with?('/')\n File.new(name)\n elsif name.start_with?('~')\n File.new(name.gsub('~', \"#{ENV['HOME']}\"))\n else\n File.new(File.join(sandbox, name))\n end\n end", "def open_file(file_name = file_path, options = 'rb')\n # chek if the file name really exists, otherwise raise an exception\n if !File.exists?(file_name)\n raise(IOError, \"File #{file_name} could not be opened.\", caller)\n end\n \n # try to open the specified file if is not already open\n if @file_handle == nil\n @file_handle = File.open(file_name, options)\n \n # check and set the initial position of the reading cursors.\n # It's necessary to do this thing because we don't know if the user\n # has specified the initial reading cursors befort starting working on file\n @position ||= @file_handle.pos\n \n @file_handle.pos = @position\n end\n end", "def open_file(file_name = file_path, options = 'rb')\n # chek if the file name really exists, otherwise raise an exception\n if !File.exists?(file_name)\n raise(IOError, \"File #{file_name} could not be opened.\", caller)\n end\n \n # try to open the specified file if is not already open\n if @file_handle == nil\n @file_handle = File.open(file_name, options)\n \n # check and set the initial position of the reading cursors.\n # It's necessary to do this thing because we don't know if the user\n # has specified the initial reading cursors befort starting working on file\n @position ||= @file_handle.pos\n \n @file_handle.pos = @position\n end\n end", "def load_monkfile\n file = find_in_project(\"Monkfile\")\n\n if file\n load file\n @project = File.dirname(file)\n Dir.chdir @project\n end\n end", "def read(src_path)\n if File.exist?(src_path) && !File.directory?(src_path)\n File.read(src_path)\n else\n \"\"\n end \n end", "def load(file)\n File.open(path(file)).read\n end", "def read_file(file)\n File.read(file)\nend", "def read_file(filename)\n ext = real_extension(filename)\n method_name = 'read_' + ext\n begin\n return method(method_name).call(filename)\n rescue StandardError => e\n return nil\n end\n end", "def get_file(file_path)\n ensure_file_open!\n @file.read(file_path)\n end", "def do_file_read(f)\n File.read(f) rescue(bail \"File Read Error: #{$!}\")\n end", "def file_read\n \n aFile = File.new(\"test.txt\",\"r\")\n \n if aFile\n aFile.sysread(100)\n else\n puts \"Can not open a file for Reading!!\"\n end\nend", "def handle_file(the_file)\n begin\n f = File.open(the_file, 'r')\n rescue SystemCallError\n puts \"No such file: #{the_file}\"\n return false\n end\n f\n end", "def source_for(path)\n read(path, false)\n end", "def project_load\n (project_dir = reachable_projects.first) || raise(InputError, \"Could not find a project file containing #{path}\")\n @project = ProjectCache.open(project_dir)\n end", "def open_path(path)\n begin\n File.new(path, 'r')\n rescue \n puts \"Could not open provided path #{path}\\n\"\n exit\n end \n end", "def getContentsFromFile filetoread\n return File.read(Dir.pwd + '/' + filetoread)\nend", "def getContentsFromFile filetoread\n return File.read(Dir.pwd + '/' + filetoread)\nend", "def read(filename)\n buffer = File.read filename if File.exist? filename\n end", "def read(filename)\n buffer = File.read filename if File.exist? filename\n end", "def from_file(file)\n from_s Utils::read_file file\n end", "def from_file(file)\n from_s Utils::read_file file\n end", "def readFile(fileName)\n begin\n fContent = File.open(fileName).read\n rescue DefaultException => e\n puts \"Reading repository file failed :#{fileName}\"\n end\n end", "def path_to_file(file)\n # return if we already have the full file path\n return file if File.exist?(file)\n path = importerexporter.parser.path_to_files\n f = File.join(path, file)\n return f if File.exist?(f)\n raise \"File #{f} does not exist\"\n end", "def path_to_file(file)\n # return if we already have the full file path\n return file if File.exist?(file)\n path = importerexporter.parser.path_to_files\n f = File.join(path, file)\n return f if File.exist?(f)\n raise \"File #{f} does not exist\"\n end", "def spec_file(filename)\n File.open('spec/files/'+filename) { |f| f.read }\n end", "def local_file(file)\n File.join @cwd, file\n end", "def read_file name\n\topen(\"https://raw.githubusercontent.com/NotEnoughIdea/Ideas/master/resources/#{name}.txt\").read\nend", "def read_file path, options = {}\n File.read resolve_path(path, options)\n end", "def _open(filename)\n File.open(filename, 'rb')\n end", "def file\n @file ||= find_file\n end", "def read_file(file_name)\n begin\n content = File.open(file_name).read\n return content\n rescue\n raise\n end\n end", "def read(path); end", "def load(file_path); end", "def load(file_path); end", "def opx_file_open_read(file, fatal = false)\n File.open(file, \"r\")\n rescue => e\n (fatal ?\n opx_err(\"Fatal failure of File.open (for read): #{file}\", e) :\n opx_err(\"File open error: #{file}\", e))\n end", "def open_file(handle)\n (handle.respond_to?(:path) ? handle : File.open(handle.to_s))\n rescue Errno::ENOENT\n nil\n end", "def open_file(handle)\n (handle.respond_to?(:path) ? handle : File.open(handle.to_s))\n rescue Errno::ENOENT\n nil\n end", "def read_file(file)\n File.read(file)\n end", "def read_file(file)\n File.read(file)\n end", "def read_file(file)\n File.exist?(file.to_s) ? IO.read(file) : \"\"\n end", "def readFile(fname)\n\tinf = File.new(fname, \"r\")\n\tret = inf.read()\n\tinf.close\n\treturn ret\nend", "def load_source(template)\n filename = File.join(path, template)\n\n return unless File.file?(filename)\n\n File.read filename\n end", "def open(_filename, _mode = 'r')\n raise NotImplementedError\n end", "def working_file(file)\n \"#{working_dir}/#{file_string(file)}\"\n end", "def findFile(file)\n file = file.to_s\n\n # check if absolute and exists\n if Pathname.new(file).absolute?\n if File.exist?(file)\n return OpenStudio::OptionalPath.new(OpenStudio.toPath(file))\n end\n\n # absolute path does not exist\n return OpenStudio::OptionalPath.new\n end\n\n absoluteFilePaths.each do |file_path|\n result = File.join(file_path.to_s, file)\n if File.exist?(result)\n return OpenStudio::OptionalPath.new(OpenStudio.toPath(result))\n end\n end\n OpenStudio::OptionalPath.new\n end", "def ovl_expand_file(rel_file)\n if File.exist?(rel_file)\n File.expand_path(rel_file)\n elsif File.exist?(a=File.join(GEM_ROOT, rel_file))\n File.expand_path(a)\n else\n raise Errno::ENOENT, rel_file\n end\n end", "def ovl_expand_file(rel_file)\n if File.exist?(rel_file)\n File.expand_path(rel_file)\n elsif File.exist?(a=File.join(GEM_ROOT, rel_file))\n File.expand_path(a)\n else\n raise Errno::ENOENT, rel_file\n end\n end" ]
[ "0.70322126", "0.67769605", "0.663163", "0.6585881", "0.65428025", "0.6354542", "0.63190085", "0.63149667", "0.63071203", "0.62838364", "0.62745726", "0.6266581", "0.6263687", "0.62383866", "0.62383866", "0.62296194", "0.6216855", "0.6201136", "0.61948687", "0.6175239", "0.6171087", "0.6163014", "0.6153744", "0.61029905", "0.61019003", "0.6099083", "0.609505", "0.609505", "0.60942155", "0.60929805", "0.6088039", "0.6068471", "0.6048143", "0.60199356", "0.59941036", "0.59886944", "0.5984249", "0.5982963", "0.596697", "0.596697", "0.593367", "0.59164715", "0.59126085", "0.5902516", "0.5898975", "0.5896544", "0.5891193", "0.58897334", "0.58849305", "0.5880197", "0.587301", "0.5868969", "0.58587086", "0.58584034", "0.58575064", "0.58575064", "0.585588", "0.584389", "0.5836887", "0.5812271", "0.58055156", "0.5805255", "0.58002394", "0.57977474", "0.57960397", "0.5794166", "0.57925326", "0.5778507", "0.5775939", "0.5775939", "0.57709867", "0.57709867", "0.5764848", "0.5764848", "0.5764806", "0.57530135", "0.57530135", "0.5739442", "0.57367754", "0.5730414", "0.5729302", "0.57181555", "0.5716639", "0.5715642", "0.57138866", "0.5697382", "0.5697382", "0.56889373", "0.5681708", "0.56812423", "0.5680719", "0.5680719", "0.5677361", "0.5674576", "0.56692886", "0.566879", "0.56685835", "0.56655467", "0.56647176", "0.56647176" ]
0.69019765
1
GET /germinations GET /germinations.json
def index @germinations = Germination.all #Para traer todas las imagenes @pictures = GeneticBankPicture.group(:genetic_bank_id) @germinationsGrid = initialize_grid(Germination, include: [:seed]) @geneticBankImagesPath = "/assets/images/geneticBank/" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_germination\n @germination = Germination.find(params[:id])\n end", "def available_grade_levels_json\n params.require(:workspace_id)\n\n # schools\n school_ids = queries.supported_schools.map(&:id).select do |school_id|\n queries.is_authorized_for_school_id?(school_id)\n end\n schools_json = School.find(school_ids).as_json(only: [:id, :name])\n\n # grade levels (include if any of their schools would allow it)\n grade_levels_next_year = queries.supported_grade_levels_next_year.select do |grade_level_next_year|\n grade_level_now = GradeLevels.new.previous(grade_level_next_year)\n school_ids.any? {|school_id| queries.is_authorized_for_grade_level_now?(school_id, grade_level_now) }\n end\n\n render json: {\n schools: schools_json,\n grade_levels_next_year: grade_levels_next_year\n }\n end", "def index\n @lounges = Lounge.all\n end", "def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end", "def getMerchants\n\tbegin\n\t\tresponse = RestClient.get('http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40')\n\trescue\n\t\tputs \"error retrieving response...\"\n\tend\n\n\tmerchants = JSON.parse(response)\n\treturn merchants\nend", "def create\n @germination = Germination.new(germination_params)\n\n respond_to do |format|\n if @germination.save\n format.html { redirect_to @germination, notice: 'Germination was successfully created.' }\n format.json { render :show, status: :created, location: @germination }\n else\n format.html { render :new }\n format.json { render json: @germination.errors, status: :unprocessable_entity }\n end\n end\n end", "def students_with_low_grades_json\n safe_params = params.permit(:educator_id, :time_now, :limit)\n educator = current_educator_or_doppleganger(safe_params[:educator_id])\n time_now = time_now_or_param(safe_params[:time_now])\n limit = safe_params[:limit].to_i\n time_threshold = time_now - 45.days\n grade_threshold = 69\n\n insight = InsightStudentsWithLowGrades.new(educator)\n students_with_low_grades_json = insight.students_with_low_grades_json(time_now, time_threshold, grade_threshold)\n render json: {\n limit: limit,\n total_count: students_with_low_grades_json.size,\n students_with_low_grades: students_with_low_grades_json.first(limit)\n }\n end", "def volunter_by_me\n @requests = @current_user.volunters.map(&:request)\n json_response(@requests)\n end", "def update\n respond_to do |format|\n if @germination.update(germination_params)\n format.html { redirect_to @germination, notice: 'Germination was successfully updated.' }\n format.json { render :show, status: :ok, location: @germination }\n else\n format.html { render :edit }\n format.json { render json: @germination.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\r\n @legers = Leger.all\r\n\r\n end", "def index\n @minerals = Mineral.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @minerals }\n end\n end", "def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end", "def surgery_name_list\n\t\tsurgeries = current_user.surgeries\n\t\tif surgeries.present?\n\t\t# response to the JSON\n \t render json: { success: true, response: {surgeries: surgeries.collect(&:name).as_json } },:status=> 200\n\t else\n\t render :json=> { success: false, message: \"Surgeries are not present\" },:status=> 203\n\t end \n\tend", "def index\n @gentres = Gentre.all\n end", "def badges\n get(\"user/#{user_id}/badges.json\")\n end", "def index\n @guests = Guest.all.order(:last_name)\n respond_with(@guests) do |format|\n format.to_json { @guests.to_json(:include => [:party, :group]) }\n end\n end", "def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end", "def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end", "def index\n render json: serializer_class.new(paginate(ecf_unfunded_mentors)).serializable_hash.to_json\n end", "def index\n @allergens = Allergen.all\n #@allergens.to_json\n #render layout: false\n #format.json { render json: @allergens,status: :unprocessable_entity }\n render :json => @allergens\n end", "def index\n @grams = Gram.all #if we wanted to make an app so that user can only see their own pin make = current_user.pins.all if not Gram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grams }\n end\n end", "def garments\n garments = []\n self.closets.map do |closet|\n closet.garments.map do |garment|\n garments.push({id: garment.id, name: garment.name, garment_style: garment.garment_style, garment_type: garment.garment_type, is_favorite: garment.is_favorite, is_clean: garment.is_clean, closet_id: garment.closet_id, image: garment.image, temperatures: garment.temperatures, user: garment.user, lowest_temp: garment.lowest_temp, highest_temp: garment.highest_temp, garment_weight: garment.garment_weight, temperatures: garment.temperatures, temperature_ranges: garment.temperature_ranges})\n end\n end\n garments\n end", "def index\n @gravities = Gravity.all\n end", "def index\n @undergraduate_majors = UndergraduateMajor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @undergraduate_majors }\n end\n end", "def index\n @german_go_leagues = GermanGoLeague.all\n\t\t@title = \"Bundesliga Spiele\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @german_go_leagues }\n end\n end", "def index\n session[:admin] = true\n @badges = Badge.order('approved_at desc,id')\n @fri_count = Badge.select { |b| b.friday? }.size\n @sat_count = Badge.select { |b| b.saturday? }.size\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges }\n end\n end", "def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end", "def index\n @ped_strategies = PedStrategy.order(\"hierarchy\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ped_strategies }\n end\n end", "def show\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golfer }\n end\n end", "def index\n @lugars = Lugar.all\n\n render json: @lugars\n end", "def get_grades\r\n grade_nodes = BankNodestructure.grade_gather(params[:subject])\r\n render json: grade_nodes.to_json\r\n end", "def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end", "def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end", "def index\n @leads = Lead.upcoming\n .includes(:updates, :agents, :agent)\n .order(created_at: :desc)\n .page(params[:page])\n .per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leads }\n end\n end", "def building_and_grounds\n bag = SuperSuperCategory.find_by(name: \"Facilities\")\n super_categories = bag.super_categories\n\n if params[:org]\n @data = build_from_super_super_categories(super_categories, params[:org].to_i)\n else\n @data = build_from_super_super_categories(super_categories, 0)\n end\n\n render json: @data\n end", "def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\n end\n end", "def index\n order = sortable_column_order, \"gage_number desc\"\n @gages = Gage.paginate page: params[:page], order: order, per_page: 50\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gages }\n end\n end", "def index\n @lounges = Lounge.new \n @all_lounges = Lounge.all\n end", "def index\n @passengers = Passenger.all\n respond_to do |format|\n format.html\n format.json { render :json => @passengers}\n end\n end", "def index\n @designations = Designation.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @designations }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n format.ext_json { render :json => find_dungeons.to_ext_json(:class => Dungeon, :count => Dungeon.count(options_from_search(Dungeon))) }\n end\n end", "def index\n @relatorio_gerals = RelatorioGeral.all.page(params[:page]).per(15)\n authorize @relatorio_gerals\n end", "def index\n @garrages = Garrage.all\n end", "def my_volunteerings\n volunteering = Volunteer.where(user_id: @current_user.id)\n if volunteering\n render json: volunteering, :include => {\n :request => {\n :only => [:id, :title, :reqtype, :description, :lat, :lng, :address, :status],\n :include => {\n :user => {\n :only => [:id, :firstname, :lastname]\n }\n }\n }\n },\n status: :ok\n else\n render json: {\n status: 'no content',\n message: 'No volunteering found'\n },\n status: :no_content\n end\n end", "def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end", "def departments\n render json: Department.all.order(:name).includes(:regional_name).map{|x| {id: x.id, name: x.rgnl_name}}\n end", "def index\n if (params[:client_id])\n @engagements = Engagement.find_all_by_client_id(params[:client_id])\n else\n @engagements = Engagement.all\n end\n\n respond_with(@engagements)\n end", "def index\n @riggings = Rigging.all\n end", "def index\n @level_progrations = LevelProgration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @level_progrations }\n end\n end", "def new\n @golfer = Golfer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @golfer }\n end\n end", "def index\n @ledgers = Ledger.all\n end", "def index\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @leases }\n end\n end", "def index\n @flyer_infos = FlyerInfo.all(:select => \"id, topimg, sideimg, capacity, speed, stormresist, multiplier, price, tier, load_time, disabled\")\n @language = ApplicationHelper.preferred_language(request.headers[\"Accept-Language\"])\n\n @complete_flyers = @flyer_infos.collect { |flyer_info|\n flyer_info.as_json.merge(FlyerInfosHelper.getflyerloc(flyer_info, @language).first.as_json)\n }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complete_flyers }\n end\n end", "def get_region\n respond_to do |format|\n format.json{ render :json => { :region => Region.all } }\n end\n end", "def index\n @users = User.myfamily(current_user).includes_ext.order(:generation)\n @users += User.notfamily(current_user).includes_ext.order(\"root11, generation\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end", "def get_data\n users_without_admin = User.where(\"name != 'admin'\").count\n users = Userarchyves.select('user_id, food, voted_for').where(archyves_id: current_round.id).all\n retaurants = Restaurant.select('id, votes').all\n \n # return json \n respond_to do |format|\n format.json {\n render json: {\n users: users.as_json(only: [:user_id, :food, :voted]),\n restaurants: retaurants.as_json(only: [:id, :votes]),\n winner: winner.as_json(only: [:id]),\n food_history: food_history.as_json(only: [:food]),\n round_end: round_ended?.as_json\n }\n }\n end\n end", "def maneuvers\n if valid\n route[:legs].first[:maneuvers]\n end\n end", "def get_versions\r\n versions_nodes = BankNodestructure.version_gather(params[:subject], params[:grade])\r\n render json: versions_nodes.to_json\r\n end", "def get_agreements\n get_agreements_response = Echochamber::Request.get_agreements(token)\n get_agreements_response.fetch(\"userAgreementList\")\n end", "def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end", "def index\n @frais_hebergements = FraisHebergement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_hebergements }\n end\n end", "def metageneration\n @gapi[\"metageneration\"]\n end", "def index\n @reward_and_levels = RewardAndLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reward_and_levels }\n end\n end", "def index\n @galleta = Galletum.all\n end", "def index\n @degres = Degre.all\n end", "def index\n respond_to do |format|\n format.html # index.html.erb (no data required)\n format.ext_json { render :json => find_contract_litigations.to_ext_json(:class => ContractLitigation, :count => ContractLitigation.count(options_from_search(ContractLitigation)), :include => [:contract]) }\n end\n end", "def show\n @badge = Badge.find(params[:id])\n @users = @badge.users\n respond_with @badge\n end", "def index\n @delivery_men = DeliveryMan.all\n\n render json: @delivery_men, :each_serializer => ShortDeliveryManSerializer\n end", "def index_by_age_sorted_by_price\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end", "def index\n @surgeries = Surgery.all\n end", "def index\n @surgeries = Surgery.all\n end", "def index\n @garments = Garment.all\n end", "def index\n @drugs = Drug.all\n # @permitted_drugs = Drug.permitted.alphabetical.all\n # @prohibited_drugs = Drug.prohibited.alphabetical.all\n # @restricted_drugs = Drug.restricted.alphabetical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drugs }\n end\n end", "def index\n @aggrupations = Aggrupation.all\n end", "def dates\n render json: @standings\n end", "def regions\n @regions = Region.all\n\n render json: @regions.to_json(:include => :vertices)\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward_and_level }\n end\n end", "def get_levels\n if params[:levels_by_nf] == 'true'\n @foundation = Foundation.find_by(name: params[:name])\n if @foundation\n render json: {levels: @foundation.levels.pluck(:name)}, status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n return\n end\n\n @foundation = Foundation.find_by(id: params[:id])\n if @foundation\n render template: 'levels/get_levels.json', status: 200\n else\n render json: {\n levels: []\n }, status: 200\n end\n end", "def show\n render json: @endorsement\n end", "def index\n @recent = Highfive.recent.approved\n @leaders = User.leaders\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @highfives }\n end\n end", "def index\n @chargers = Charger.all\n render json: @chargers\n end", "def index\n @allocations = Allocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @allocations }\n end\n end", "def index\n @merches = Merch.all\n end", "def statistics\n JSON.parse @gapi.statistics.to_json\n end", "def index\n @garplies = Garply.all\n end", "def index\n @guests = @wedding.guests.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guests }\n end\n end", "def index\n @specific_gravities = @batch.specific_gravities\n end", "def index\n\t\tsurgery_locations = SurgeryLocation.all\n\t\tif surgery_locations.present?\n\t # response to the JSON\n\t render json: { success: true, response: surgery_locations.map{ |f| SurgeryLocationSerializer.new(f).as_json( root: false ) } }\n\t else\n\t render :json=> { success: false, message: \"Surgery Location is not present.\" },:status=> 203\n\t end \n\tend", "def index\n @elder_gallaries = current_user.elder_gallaries rescue nil\n end", "def getmininginfo\n @api.request 'getmininginfo'\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_progration }\n end\n end", "def index\n @litters = Litter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @litters }\n end\n end", "def index\n if @patron\n @patron_merges = @patron.patron_merges.order('patron_merges.id').page(params[:page])\n elsif @patron_merge_list\n @patron_merges = @patron_merge_list.patron_merges.order('patron_merges.id').includes(:patron).page(params[:page])\n else\n @patron_merges = PatronMerge.page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @patron_merges }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end", "def index\n @fights = Fight.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fights.to_json( :include => { :field_initial => { :only => [:name] }, :field_actual => { :only => [:name] }, :category => { :only => [:name] }, :competitor_blue => { :only => [:last_name, :lot_number] }, :competitor_red => { :only => [:last_name, :lot_number] }, :competitor_winner => { :only => [:last_name, :lot_number] }, :previous_fight_blue => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } }, :previous_fight_red => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } } } ) }\n end\n end", "def index\n @registrations = Registration.order(:last_name).where(\"created_at >= ?\", Date.today.beginning_of_year)\n\n respond_to do |format|\n format.html\n format.json { render json: @registrations, include: { students: { only: [:first_name, :last_name, :shirt_size]}} }\n end\n end", "def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end", "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "def index\n\n @sorter = LevelSorter.new(params)\n\n if @sorter.default?\n @featured_levels = [\n FeaturedLevel.newest,\n FeaturedLevel.hardest]\n @featured_levels << FeaturedLevel.random(:excluding => @featured_levels)\n\n @featured_levels.compact!\n end\n\n page_size = @sorter.default? ? 9 : 12\n\n @levels = Level.includes(:creator).\n order(\"#{@sorter.column} #{@sorter.direction}\").\n paginate(:page => params[:page], :per_page => page_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @levels }\n end\n end", "def index\n calendriers = Calendrier.find_by(logement_id:params[:logement_id])\n promotion = Promotion.where(logement_id:params[:logement_id])\n delaimin = calendriers.delaimin\n nuitmin =calendriers.nuitmin\n ouvrir = calendriers.ouvrir\n tarif = calendriers.tarif\n\n\n debut = calendriers.startDate\n fin = calendriers.endDate\n \n dd=debut.day\n dm=debut.month\n dy=debut.year\n\n fd=fin.day\n fm=fin.month\n fy=fin.year\n #modifer la forme de la date de début\n starts = \"#{dy}-#{dm}-#{dd}\"\n #modifer la forme de la date de fin\n\n ends = \"#{fy}-#{fm}-#{fd}\"\n\n render json:{\n debut:starts,\n fin:ends,\n delaimin:delaimin,\n nuitmin:nuitmin,\n ouvrir:ouvrir,\n tarif:tarif,\n promotion:promotion\n }\n end" ]
[ "0.62024117", "0.5742523", "0.5732085", "0.57247204", "0.5688935", "0.5633007", "0.5629104", "0.56258285", "0.5622049", "0.56045717", "0.5602284", "0.55787754", "0.5567271", "0.5517237", "0.55168563", "0.54796255", "0.54434246", "0.5431874", "0.5428535", "0.5419062", "0.5407096", "0.54057354", "0.53883946", "0.53636634", "0.536316", "0.53558075", "0.5345055", "0.5344028", "0.5321361", "0.5318753", "0.5318039", "0.53168905", "0.5314473", "0.5314325", "0.53079605", "0.5300413", "0.529664", "0.5292294", "0.5287385", "0.52855265", "0.52787983", "0.5277945", "0.5272223", "0.52465063", "0.52305925", "0.5219019", "0.52183044", "0.5209589", "0.51992625", "0.51924497", "0.5190563", "0.51877207", "0.5187168", "0.5186276", "0.5183456", "0.51818943", "0.5169832", "0.5168161", "0.51640826", "0.51613724", "0.5152664", "0.5137383", "0.51359904", "0.51111776", "0.5109968", "0.51068985", "0.5100708", "0.5100287", "0.5100191", "0.5086439", "0.5085445", "0.5085445", "0.5080557", "0.5078387", "0.50765246", "0.507546", "0.50736785", "0.5073158", "0.5071796", "0.5070709", "0.5067738", "0.50670236", "0.5066249", "0.50652033", "0.50627506", "0.5053703", "0.50497454", "0.5046777", "0.5041623", "0.5040812", "0.5035152", "0.5034706", "0.50338453", "0.502859", "0.50240386", "0.5023039", "0.5019327", "0.5019163", "0.5016449", "0.50139856", "0.5011346" ]
0.0
-1
GET /germinations/1 GET /germinations/1.json
def show @pictures = GeneticBankPicture.group(:genetic_bank_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_germination\n @germination = Germination.find(params[:id])\n end", "def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end", "def show\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golfer }\n end\n end", "def index\n @minerals = Mineral.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @minerals }\n end\n end", "def getMerchants\n\tbegin\n\t\tresponse = RestClient.get('http://api.reimaginebanking.com/merchants?key=e0486a76005721ee6d86b140eaea2a40')\n\trescue\n\t\tputs \"error retrieving response...\"\n\tend\n\n\tmerchants = JSON.parse(response)\n\treturn merchants\nend", "def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end", "def new\n @golfer = Golfer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @golfer }\n end\n end", "def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end", "def index\n @lounges = Lounge.all\n end", "def index\r\n @legers = Leger.all\r\n\r\n end", "def badges\n get(\"user/#{user_id}/badges.json\")\n end", "def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end", "def show\n @mineral = Mineral.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mineral }\n end\n end", "def create\n @germination = Germination.new(germination_params)\n\n respond_to do |format|\n if @germination.save\n format.html { redirect_to @germination, notice: 'Germination was successfully created.' }\n format.json { render :show, status: :created, location: @germination }\n else\n format.html { render :new }\n format.json { render json: @germination.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gauge }\n end\n end", "def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end", "def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end", "def update\n respond_to do |format|\n if @germination.update(germination_params)\n format.html { redirect_to @germination, notice: 'Germination was successfully updated.' }\n format.json { render :show, status: :ok, location: @germination }\n else\n format.html { render :edit }\n format.json { render json: @germination.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @german_go_leagues = GermanGoLeague.all\n\t\t@title = \"Bundesliga Spiele\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @german_go_leagues }\n end\n end", "def volunter_by_me\n @requests = @current_user.volunters.map(&:request)\n json_response(@requests)\n end", "def show\n @gastracker = Gastracker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gastracker }\n end\n end", "def show\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotel }\n end\n end", "def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end", "def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end", "def new\n @gage = Gage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gage }\n end\n end", "def show\n @badge = Badge.find(params[:id])\n @users = @badge.users\n respond_with @badge\n end", "def index\n @gentres = Gentre.all\n end", "def show\n @messege = Messege.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @messege }\n end\n end", "def index\n @lugars = Lugar.all\n\n render json: @lugars\n end", "def new\n @gastracker = Gastracker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gastracker }\n end\n end", "def show\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_grappt }\n end\n end", "def students_with_low_grades_json\n safe_params = params.permit(:educator_id, :time_now, :limit)\n educator = current_educator_or_doppleganger(safe_params[:educator_id])\n time_now = time_now_or_param(safe_params[:time_now])\n limit = safe_params[:limit].to_i\n time_threshold = time_now - 45.days\n grade_threshold = 69\n\n insight = InsightStudentsWithLowGrades.new(educator)\n students_with_low_grades_json = insight.students_with_low_grades_json(time_now, time_threshold, grade_threshold)\n render json: {\n limit: limit,\n total_count: students_with_low_grades_json.size,\n students_with_low_grades: students_with_low_grades_json.first(limit)\n }\n end", "def show\n @generation = Generation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generation }\n end\n end", "def new\n @engagement = Engagement.new\n @clients = Client.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @engagement }\n end\n end", "def index\n @allergens = Allergen.all\n #@allergens.to_json\n #render layout: false\n #format.json { render json: @allergens,status: :unprocessable_entity }\n render :json => @allergens\n end", "def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end", "def index\n @undergraduate_majors = UndergraduateMajor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @undergraduate_majors }\n end\n end", "def show\n @gig_request = GigRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gig_request }\n end\n end", "def show\n @gemm = Gemm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @gemm }\n end\n end", "def index\n @guests = Guest.all.order(:last_name)\n respond_with(@guests) do |format|\n format.to_json { @guests.to_json(:include => [:party, :group]) }\n end\n end", "def index\n @grams = Gram.all #if we wanted to make an app so that user can only see their own pin make = current_user.pins.all if not Gram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grams }\n end\n end", "def new\n @gauge = Gauge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gauge }\n end\n end", "def show\n @lodge = Lodge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lodge }\n end\n end", "def index\n @lounges = Lounge.new \n @all_lounges = Lounge.all\n end", "def show\n @bergain = Bergain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bergain }\n end\n end", "def show\n @bergain = Bergain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bergain }\n end\n end", "def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end", "def show\n @meritbadge = Meritbadge.find(params[:id])\n # @requirements = Requirement.find_all_by_meritbadge_id(params[:id])\n @requirements = ScouterMeritbadges.find_by_meritbadge_id_and_scouter_id(params[:id], current_scouter)\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meritbadge }\n end\n end", "def new\n @groep = Groep.new\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groep }\n end\n end", "def available_grade_levels_json\n params.require(:workspace_id)\n\n # schools\n school_ids = queries.supported_schools.map(&:id).select do |school_id|\n queries.is_authorized_for_school_id?(school_id)\n end\n schools_json = School.find(school_ids).as_json(only: [:id, :name])\n\n # grade levels (include if any of their schools would allow it)\n grade_levels_next_year = queries.supported_grade_levels_next_year.select do |grade_level_next_year|\n grade_level_now = GradeLevels.new.previous(grade_level_next_year)\n school_ids.any? {|school_id| queries.is_authorized_for_grade_level_now?(school_id, grade_level_now) }\n end\n\n render json: {\n schools: schools_json,\n grade_levels_next_year: grade_levels_next_year\n }\n end", "def index\n order = sortable_column_order, \"gage_number desc\"\n @gages = Gage.paginate page: params[:page], order: order, per_page: 50\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gages }\n end\n end", "def show\n @tagging = Tagging.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tagging }\n end\n end", "def show\n @regulation = Regulation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @regulation }\n end\n end", "def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end", "def show\n @governor = Governor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @governor }\n end\n end", "def new\n @gravity = Gravity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gravity }\n end\n end", "def show\n @immigrant = Immigrant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @immigrant }\n end\n end", "def new\n @gopy = Gopy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gopy }\n end\n end", "def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end", "def show\n @gravity = Gravity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gravity }\n end\n end", "def show\n @galeria = Galeria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @galeria }\n end\n end", "def index\n @pledges = Pledge.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pledges }\n end\n end", "def get_region\n respond_to do |format|\n format.json{ render :json => { :region => Region.all } }\n end\n end", "def show\n @grm = Grm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm }\n end\n end", "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end", "def show\n @wager = Wager.find(params[:id])\n\n render json: @wager\n end", "def index\n @pledges = if current_admin?\n User.find(params[:user_id]).pledges\n else\n current_user.pledges\n end\n respond_to do |format|\n format.html\n format.json { render json: @pledges }\n end\n end", "def get_batterie_by_building\n @battery = Battery.where(building_id: params[:building_id])\n respond_to do |format| \n format.json { render :json => @battery }\n end\n \n end", "def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @badge }\n end\n end", "def index\n @passengers = Passenger.all\n respond_to do |format|\n format.html\n format.json { render :json => @passengers}\n end\n end", "def index\n @chargers = Charger.all\n render json: @chargers\n end", "def new\n @meritbadge = Meritbadge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meritbadge }\n end\n end", "def new\n @badge = Badge.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @badge }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_progration }\n end\n end", "def new\n @bergain = Bergain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bergain }\n end\n end", "def new\n @bergain = Bergain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bergain }\n end\n end", "def index\n @designations = Designation.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @designations }\n end\n end", "def index\n @garrages = Garrage.all\n end", "def show\n @generator = Generator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generator }\n end\n end", "def show\n render json: Agent.find(params[:id]).buyers\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward_and_level }\n end\n end", "def show\n @dossier = Dossier.find(params[:id])\n @registers = @dossier.registers.order(\"date_register DESC\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dossier }\n end\n end", "def show\n @gram = Gram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gram }\n end\n end", "def new\n @messege = Messege.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @messege }\n end\n end", "def show\n @bruger = Bruger.find_by_id(current_user.id)\n @onske = Onske.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onske }\n end\n end", "def index\n @riggings = Rigging.all\n end", "def surgery_name_list\n\t\tsurgeries = current_user.surgeries\n\t\tif surgeries.present?\n\t\t# response to the JSON\n \t render json: { success: true, response: {surgeries: surgeries.collect(&:name).as_json } },:status=> 200\n\t else\n\t render :json=> { success: false, message: \"Surgeries are not present\" },:status=> 203\n\t end \n\tend", "def new\n @genu = Genu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genu }\n end\n end", "def index\n session[:admin] = true\n @badges = Badge.order('approved_at desc,id')\n @fri_count = Badge.select { |b| b.friday? }.size\n @sat_count = Badge.select { |b| b.saturday? }.size\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @badges }\n end\n end", "def index\n @gravities = Gravity.all\n end", "def index\n @galleta = Galletum.all\n end", "def index\n @flyer_infos = FlyerInfo.all(:select => \"id, topimg, sideimg, capacity, speed, stormresist, multiplier, price, tier, load_time, disabled\")\n @language = ApplicationHelper.preferred_language(request.headers[\"Accept-Language\"])\n\n @complete_flyers = @flyer_infos.collect { |flyer_info|\n flyer_info.as_json.merge(FlyerInfosHelper.getflyerloc(flyer_info, @language).first.as_json)\n }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complete_flyers }\n end\n end", "def new\n @galeria = Galeria.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @galeria }\n end\n end", "def index\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @leases }\n end\n end", "def metageneration\n @gapi[\"metageneration\"]\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @supervisions }\n end\n end", "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "def show\n @guest = Guest.find(params[:id])\n respond_with(@guest) do |format|\n format.to_json { @guest.to_json(:include => [:party, :group]) }\n end\n end", "def show\n @allergy = Allergy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @allergy }\n end\n end", "def getmininginfo\n @api.request 'getmininginfo'\n end", "def new\n #@gethotel = Gethotel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotel }\n end\n end" ]
[ "0.65823025", "0.5954642", "0.587647", "0.5749051", "0.5746271", "0.5726184", "0.57108116", "0.56986123", "0.56787467", "0.5635924", "0.56314933", "0.5631135", "0.56106675", "0.55862164", "0.55854744", "0.5563536", "0.5556098", "0.55455", "0.5529545", "0.55290306", "0.5522159", "0.55118346", "0.54885566", "0.54752827", "0.54375756", "0.5434661", "0.5423197", "0.54172087", "0.540644", "0.538825", "0.5378548", "0.53665984", "0.5361154", "0.5358017", "0.53574216", "0.53559494", "0.5355682", "0.535364", "0.5341917", "0.53372335", "0.53337765", "0.53317064", "0.532756", "0.5323852", "0.5317038", "0.5317038", "0.5314192", "0.5309495", "0.5308961", "0.53073657", "0.5306659", "0.5303732", "0.5300421", "0.5298785", "0.52931744", "0.529247", "0.52915365", "0.52895355", "0.52890426", "0.52797246", "0.527854", "0.52752244", "0.52704906", "0.52704895", "0.526819", "0.52654636", "0.5263552", "0.5260595", "0.525524", "0.52441025", "0.5231045", "0.52275854", "0.5222924", "0.52196854", "0.52181315", "0.52181315", "0.52172697", "0.52166694", "0.5216465", "0.52110344", "0.5209925", "0.5200956", "0.5193884", "0.5192061", "0.5187523", "0.5183892", "0.51828456", "0.5181818", "0.5173543", "0.5172526", "0.5169468", "0.5165172", "0.5164342", "0.51636237", "0.51621115", "0.51612943", "0.51556814", "0.51478285", "0.5146174", "0.51413155", "0.51329815" ]
0.0
-1
POST /germinations POST /germinations.json
def create @germination = Germination.new(germination_params) respond_to do |format| if @germination.save format.html { redirect_to @germination, notice: 'Germination was successfully created.' } format.json { render :show, status: :created, location: @germination } else format.html { render :new } format.json { render json: @germination.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def germination_params\n params.require(:germination).permit(:seed_id, :week, :numGerminations,:codeCross, :codeCrossNumRepeat, :totalNumRepeat, :totalCode, :missingSeed)\n end", "def set_germination\n @germination = Germination.find(params[:id])\n end", "def update\n respond_to do |format|\n if @germination.update(germination_params)\n format.html { redirect_to @germination, notice: 'Germination was successfully updated.' }\n format.json { render :show, status: :ok, location: @germination }\n else\n format.html { render :edit }\n format.json { render json: @germination.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @aggrupation = Aggrupation.new(aggrupation_params)\n\n respond_to do |format|\n if @aggrupation.save\n format.html { redirect_to @aggrupation, notice: 'Aggrupation was successfully created.' }\n format.json { render :show, status: :created, location: @aggrupation }\n else\n format.html { render :new }\n format.json { render json: @aggrupation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @galletum = Galletum.new(galletum_params)\n\n respond_to do |format|\n if @galletum.save\n format.html { redirect_to @galletum, notice: 'Galletum was successfully created.' }\n format.json { render :show, status: :created, location: @galletum }\n else\n format.html { render :new }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @relatorio_gerals = RelatorioGeral.all\n authorize @relatorio_gerals\n\n @relatorio_geral = RelatorioGeral.new(relatorio_geral_params)\n\n respond_to do |format|\n if @relatorio_geral.save\n format.html { redirect_to @relatorio_geral, notice: 'Relatório geral criado com sucesso!' }\n format.json { render :show, status: :created, location: @relatorio_geral }\n else\n format.html { render :new }\n format.json { render json: @relatorio_geral.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rigging = Rigging.new(rigging_params)\n\n respond_to do |format|\n if @rigging.save\n format.html { redirect_to @rigging, notice: 'Rigging was successfully created.' }\n format.json { render :show, status: :created, location: @rigging }\n else\n format.html { render :new }\n format.json { render json: @rigging.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @garrison = Garrison.new(garrison_params)\n @garrison.kingdom_id = current_user.current_kingdom.id\n @garrison.recruted = true\n\n respond_to do |format|\n if @garrison.save\n format.html { redirect_to @garrison, notice: 'Garrison was successfully created.' }\n format.json { render action: 'show', status: :created, location: @garrison }\n else\n format.html { render action: 'new' }\n format.json { render json: @garrison.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @golfer = Golfer.new(params[:golfer])\n\n respond_to do |format|\n if @golfer.save\n format.html { redirect_to @golfer, notice: 'Golfer was successfully created.' }\n format.json { render json: @golfer, status: :created, location: @golfer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gentre = Gentre.new(gentre_params)\n\n respond_to do |format|\n if @gentre.save\n format.json { render :show, status: :created, location: @gentre }\n else\n format.json { render json: @gentre.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @alligator = Alligator.new(alligator_params)\n\n respond_to do |format|\n if @alligator.save\n format.html { redirect_to @alligator, notice: 'Alligator was successfully created.' }\n format.json { render :show, status: :created, location: @alligator }\n else\n format.html { render :new }\n format.json { render json: @alligator.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @groep = Groep.new(params[:groep])\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n if @groep.save\n format.html { redirect_to @groep, notice: 'Groep werd succesvol aangemaakt.' }\n format.json { render json: @groep, status: :created, location: @groep }\n else\n format.html { render action: \"new\" }\n format.json { render json: @groep.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @allergy = Allergy.new(allergy_params)\n\n respond_to do |format|\n if @allergy.save\n format.html { redirect_to new_allergy_path, notice: t('allergies.created') }\n format.json { render :show, status: :created, location: @allergy }\n else\n format.html { render :new, alert: t('errors.messages.empty') }\n format.json { render json: @allergy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gang = Gang.new(gang_params)\n\n respond_to do |format|\n if @gang.save\n format.html { redirect_to @gang, notice: 'Gang was successfully created.' }\n format.json { render :show, status: :created, location: @gang }\n else\n format.html { render :new }\n format.json { render json: @gang.errors, status: :unprocessable_entity }\n end\n end\n end", "def gun_params\n params.require(:gun).permit(:name, :caliber, :brand_id)\n end", "def create\n @lager = Lager.new(lager_params)\n\n respond_to do |format|\n if @lager.save\n format.html { redirect_to @lager, notice: 'Lager was successfully created.' }\n format.json { render :show, status: :created, location: @lager }\n else\n format.html { render :new }\n format.json { render json: @lager.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @graduation = Graduation.new(graduation_params)\n\n respond_to do |format|\n if @graduation.save\n format.html { redirect_to @graduation, notice: 'Graduation was successfully created.' }\n format.json { render :show, status: :created, location: @graduations }\n else\n format.html { render :new }\n format.json { render json: @graduation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @elder_gallary = ElderGallary.new(elder_gallary_params)\n\n respond_to do |format|\n if @elder_gallary.save\n format.html { redirect_to @elder_gallary, notice: 'Elder gallary was successfully created.' }\n format.json { render :show, status: :created, location: @elder_gallary }\n else\n format.html { render :new }\n format.json { render json: @elder_gallary.errors, status: :unprocessable_entity }\n end\n end\n end", "def gang_params\n params.require(:gang).permit(:flexed, :shift_id, :top_pick, :utr, :note)\n end", "def create\n @antler = Antler.new(params[:antler])\n @antler.calculate_lg_value\n\n respond_to do |format|\n if @antler.save\n format.html { redirect_to @antler, notice: 'Antler was successfully created.' }\n format.json { render json: @antler, status: :created, location: @antler }\n else\n format.html { render action: \"new\" }\n format.json { render json: @antler.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lounge = Lounge.new(lounge_params)\n\n respond_to do |format|\n if @lounge.save\n format.html { redirect_to @lounge, notice: 'Lounge was successfully created.' }\n format.json { render :show, status: :created, location: @lounge }\n else\n format.html { render :new }\n format.json { render json: @lounge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @messege = Messege.new(params[:messege])\n\n respond_to do |format|\n if @messege.save\n format.html { redirect_to @messege, notice: 'Messege was successfully created.' }\n format.json { render json: @messege, status: :created, location: @messege }\n else\n format.html { render action: \"new\" }\n format.json { render json: @messege.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @garrage = Garrage.new(garrage_params)\n @garrage.user_id = current_user.id\n\n respond_to do |format|\n if @garrage.save\n format.html { redirect_to garrage_stuffs_path(@garrage), notice: 'Garrage was successfully created.' }\n format.json { render :show, status: :created, location: @garrage }\n else\n format.html { render :new }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @incrustation = Incrustation.new(incrustation_params)\n\n respond_to do |format|\n if @incrustation.save\n record_activity(@incrustation)\n format.html { redirect_to admin_incrustations_path, notice: 'Вставка была успешно создана.' }\n format.json { render :show, status: :created, location: @incrustation }\n else\n format.html { render :new }\n format.json { render json: @incrustation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gig_request = GigRequest.new(params[:gig_request])\n\n respond_to do |format|\n if @gig_request.save\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully created.' }\n format.json { render json: @gig_request, status: :created, location: @gig_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gage = Gage.new(params[:gage])\n\n respond_to do |format|\n if @gage.save\n format.html { redirect_to @gage, notice: 'Gage was successfully created.' }\n format.json { render json: @gage, status: :created, location: @gage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @allergens_ingredient = AllergensIngredient.new(allergens_ingredient_params)\n\n respond_to do |format|\n if @allergens_ingredient.save\n format.html { redirect_to @allergens_ingredient, notice: 'Allergens ingredient was successfully created.' }\n format.json { render :show, status: :created, location: @allergens_ingredient }\n else\n format.html { render :new }\n format.json { render json: @allergens_ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @d_dungeoneer = DDungeoneer.new(d_dungeoneer_params)\n\n ActiveRecord::Base.transaction do\n respond_to do |format|\n if @d_dungeoneer.save\n format.html { redirect_to @d_dungeoneer, notice: 'D dungeoneer was successfully created.' }\n format.json { render :show, status: :created, location: @d_dungeoneer }\n else\n format.html { render :new }\n format.json { render json: @d_dungeoneer.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end", "def create\n @gudang = Gudang.new(gudang_params)\n\n respond_to do |format|\n if @gudang.save\n format.html { redirect_to @gudang, notice: 'Gudang was successfully created.' }\n format.json { render :show, status: :created, location: @gudang }\n else\n format.html { render :new }\n format.json { render json: @gudang.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gonullu = Gonullu.new(gonullu_params)\n\n respond_to do |format|\n if @gonullu.save\n format.html { redirect_to @gonullu, notice: 'Gonullu was successfully created.' }\n format.json { render :show, status: :created, location: @gonullu }\n else\n format.html { render :new }\n format.json { render json: @gonullu.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @stilage = Stilage.new(stilage_params)\n respond_to do |format|\n if @stilage.save\n format.html { redirect_to @stilage, notice: 'Stilage was successfully created.' }\n format.json { render :show, status: :created, location: @stilage }\n else\n format.html { render :new }\n format.json { render json: @stilage.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n gig = Gig.new()\n respond_to do |format|\n if update_gig(gig)\n format.html { render json: gig, status: :created, location: gig }\n format.json { render json: gig, status: :created, location: gig }\n else\n format.html { render action: \"new\" }\n format.json { render json: gig.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enhancement = Enhancement.new(params[:enhancement])\n\n respond_to do |format|\n if @enhancement.save\n format.html { redirect_to @enhancement, notice: 'Enhancement was successfully created.' }\n format.json { render json: @enhancement, status: :created, location: @enhancement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @enhancement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @uder = Uder.new(uder_params)\n\n respond_to do |format|\n if @uder.save\n format.html { redirect_to @uder, notice: 'Uder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @uder }\n else\n format.html { render action: 'new' }\n format.json { render json: @uder.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ledger = Ledger.new(ledger_params)\n\n respond_to do |format|\n if @ledger.save\n format.html { redirect_to @ledger, notice: 'Ledger was successfully created.' }\n format.json { render :show, status: :created, location: @ledger }\n else\n format.html { render :new }\n format.json { render json: @ledger.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ledger = Ledger.new(ledger_params)\n\n respond_to do |format|\n if @ledger.save\n format.html { redirect_to @ledger, notice: 'Ledger was successfully created.' }\n format.json { render :show, status: :created, location: @ledger }\n else\n format.html { render :new }\n format.json { render json: @ledger.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @rebateable = find_rebateable\n @rebate = @rebateable.rebates.build(params[:rebate])\n @sector_names = params[:sector_names] || []\n @industry_names = params[:industry_names] || []\n @rebate.tag_names = @sector_names.join(',') + \",\" + @industry_names.join(',')\n\n respond_to do |format|\n if @rebate.save\n format.html { redirect_to :id => nil }\n format.json { render json: @rebate, status: :created, location: @rebate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rebate.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mineral = Mineral.new(mineral_params)\n\n respond_to do |format|\n if @mineral.save\n format.html { redirect_to @mineral, notice: 'Mineral creado.' }\n format.json { render action: 'show', status: :created, location: @mineral }\n else\n format.html { render action: 'new' }\n format.json { render json: @mineral.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @meritbadge = Meritbadge.new(params[:meritbadge])\n\n respond_to do |format|\n if @meritbadge.save\n format.html { redirect_to(@meritbadge, :notice => 'Meritbadge was successfully created.') }\n format.xml { render :xml => @meritbadge, :status => :created, :location => @meritbadge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @meritbadge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @betraege = Betraege.new(params[:betraege])\n\n respond_to do |format|\n if @betraege.save\n format.html { redirect_to @betraege, :notice => 'Betraege was successfully created.' }\n format.json { render :json => @betraege, :status => :created, :location => @betraege }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @betraege.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @garment = Garment.new(garment_params)\n\n respond_to do |format|\n if @garment.save\n format.html { redirect_to @garment, notice: 'Garment was successfully created.' }\n format.json { render :show, status: :created, location: @garment }\n else\n format.html { render :new }\n format.json { render json: @garment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n Rails.logger.info(params)\n if params.has_key?(:name) && params.has_key?(:pdSupervisor) && params.has_key?(:pdInstitution) && params.has_key?(:pdStartYear) && params.has_key(:pdEndYear)\n # need to find the person, supervisor, and institution IDs first\n name_id = Person.find_person_id(params[:name])\n supervisor_id = Person.find_mentor_supervisor_id(params[:pdSupervisor], params[:pdInstitution])\n instit_id = Institution.find_institution_id(params[:pdInstitution])\n # check if the mentorship already exists\n unless Mentorship.exists?(:person_id => name_id, :mentor_id => supervisor_id, :institution_id => instit_id, :start => params[:pdStartYear], :end => params[:pdEndYear])\n @mentorship = Mentorship.new_degree(params[:name], params[:pdSupervisor], params[:pdInstitution], params[:pdStartYear], params[:pdEndYear])\n if @mentorship != nil && @mentorship.save\n render json: @mentorship.as_json, status: :created\n return\n end\n end\n end\n end", "def create\n @legs2 = Legs2.new(legs2_params)\n\n respond_to do |format|\n if @legs2.save\n format.html { redirect_to @legs2, notice: 'Legs2 was successfully created.' }\n format.json { render :show, status: :created, location: @legs2 }\n else\n format.html { render :new }\n format.json { render json: @legs2.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @lounges = Lounge.new(params[:lounge])\n if @lounges.save\n CustomLogger.debug(\"Lounge created\")\n CustomLogger.debug(\"--------------\") \n to_log(@lounges) \n @lounges = Lounge.new\n end\n @all_lounges = Lounge.all \n end", "def create\n @wager = Wager.new(params[:wager])\n\n if @wager.save\n render json: @wager, status: :created, location: @wager\n else\n render json: @wager.errors, status: :unprocessable_entity\n end\n end", "def create\n @grumble = Grumble.new(grumble_params)\n\n respond_to do |format|\n if @grumble.save\n format.html { redirect_to @grumble, notice: 'Grumble was successfully created.' }\n format.json { render :show, status: :created, location: @grumble }\n else\n format.html { render :new }\n format.json { render json: @grumble.errors, status: :unprocessable_entity }\n end\n end\n end", "def jaeger_quest; end", "def create\n @regulation = Regulation.new(params[:regulation])\n\n respond_to do |format|\n if @regulation.save\n format.html { redirect_to @regulation, notice: 'Regulation was successfully created.' }\n format.json { render json: @regulation, status: :created, location: @regulation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @regulation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sundry_grn = SundryGrn.new(params[:sundry_grn])\n\n respond_to do |format|\n if @sundry_grn.save\n format.html { redirect_to @sundry_grn, :notice => 'Sundry grn was successfully created.' }\n format.json { render :json => @sundry_grn, :status => :created, :location => @sundry_grn }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sundry_grn.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @degre = Degre.new(degre_params)\n\n respond_to do |format|\n if @degre.save\n format.html { redirect_to @degre, notice: 'Degre was successfully created.' }\n format.json { render :show, status: :created, location: @degre }\n else\n format.html { render :new }\n format.json { render json: @degre.errors, status: :unprocessable_entity }\n end\n end\n end", "def relatorio_geral_params\n params.require(:relatorio_geral).permit(:rg_objetivo, :rg_atendimento, :relatorio_attributes => [:relatorio_data, :aluno_id, :funcionario_id])\n end", "def create\n @badge = Badge.new(params[:badge])\n \n\n respond_to do |format|\n if @badge.save\n format.html { redirect_to @badge, notice: 'Badge was successfully created.' }\n format.json { render json: @badge, status: :created, location: @badge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @badge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @garply = Garply.new(garply_params)\n\n respond_to do |format|\n if @garply.save\n format.html { redirect_to @garply, notice: 'Garply was successfully created.' }\n format.json { render :show, status: :created, location: @garply }\n else\n format.html { render :new }\n format.json { render json: @garply.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #debugger\n @allergen = Allergen.new(allergen_params)\n #@allergen = Allergen.new\n\n respond_to do |format|\n if @allergen.save\n #format.html { redirect_to @allergen, notice: 'Allergen was successfully created.' }\n #format.json { render :show, status: :created, location: @allergen }\n #format.json { render :show, status: :created, location: @allergen } #sostituita poco tempo fa\n format.json { render json: @allergen, status: :created, location: @allergen }\n else\n #format.html { render :new }\n #format.json { render json: @allergen.errors, status: :unprocessable_entity }\n format.json { render json: @allergen.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @badge = Badge.new(params[:badge])\n\n respond_to do |format|\n if @badge.save\n format.html { redirect_to @badge, :notice => 'Badge was successfully created.' }\n format.json { render :json => @badge, :status => :created, :location => @badge }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @badge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @winding = Winding.new(winding_params)\n #Codigo para gerar gcode a 90 graus\n generate_gcode\n\n respond_to do |format|\n if @winding.save\n format.html { redirect_to @winding, notice: 'Winding was successfully created.' }\n format.json { render :show, status: :created, location: @winding }\n else\n format.html { render :new }\n format.json { render json: @winding.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @orging = Orging.new(orging_params)\n\n respond_to do |format|\n if @orging.save\n format.html { redirect_to @orging, notice: 'Orging was successfully created.' }\n format.json { render :show, status: :created, location: @orging }\n else\n format.html { render :new }\n format.json { render json: @orging.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gran_unidad = GranUnidad.new(gran_unidad_params)\n\n respond_to do |format|\n if @gran_unidad.save\n format.html { redirect_to @gran_unidad, notice: 'Gran unidad was successfully created.' }\n format.json { render action: 'show', status: :created, location: @gran_unidad }\n else\n format.html { render action: 'new' }\n format.json { render json: @gran_unidad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @bracket_golfer = BracketGolfer.new(bracket_golfer_params)\n\n respond_to do |format|\n if @bracket_golfer.save\n format.json { respond_with @bracket_golfer }\n else\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@gig = Gig.new(gig_params)\n\n @gig = current_user.gigs.build(gig_params)\n\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: \"Gig was successfully created.\" }\n format.json { render :show, status: :created, location: @gig }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gauge = Gauge.new(params[:gauge])\n\n respond_to do |format|\n if @gauge.save\n format.html { redirect_to @gauge, notice: 'Gauge was successfully created.' }\n format.json { render json: @gauge, status: :created, location: @gauge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gopy = Gopy.new(params[:gopy])\n\n respond_to do |format|\n if @gopy.save\n format.html { redirect_to @gopy, notice: 'Gopy was successfully created.' }\n format.json { render json: @gopy, status: :created, location: @gopy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gopy.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @made_in_g = MadeInG.new(made_in_g_params)\n\n respond_to do |format|\n if @made_in_g.save\n format.html { redirect_to @made_in_g, notice: 'Made in g was successfully created.' }\n format.json { render :show, status: :created, location: @made_in_g }\n else\n format.html { render :new }\n format.json { render json: @made_in_g.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gakunenn = Gakunenn.new(gakunenn_params)\n\n respond_to do |format|\n if @gakunenn.save\n format.html { redirect_to @gakunenn, notice: \"学年を追加しました\" }\n format.json { render :show, status: :created, location: @gakunenn }\n else\n format.html { render :new }\n format.json { render json: @gakunenn.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gauge_graph = GaugeGraph.new(gauge_graph_params)\n\n respond_to do |format|\n if @gauge_graph.save\n format.html { redirect_to edit_gauge_graph_path(@gauge_graph), notice: 'Gauge graph was successfully created.' }\n format.json { render :edit, status: :created, location: @gauge_graph }\n else\n format.html { render :new }\n format.json { render json: @gauge_graph.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @village = Village.new(village_params)\n\n @village.status = Status::Active\n\n @village.trainer.role = Role::Block_Trainer\n @village.trainer.status = Status::Active\n\n @village.villageinfo.status = Status::Active\n\n @village.teacher_elem.role = Role::Teacher\n @village.teacher_elem.status = Status::Active\n @village.teacher_elem.grade = 1 # Elem\n \n @village.teacher_mid.role = Role::Teacher\n @village.teacher_mid.status = Status::Active\n @village.teacher_mid.grade = 2 # Mid\n\n @village.teacher_high.role = Role::Teacher\n @village.teacher_high.status = Status::Active\n @village.teacher_high.grade = 3 # High\n\n respond_to do |format|\n if @village.save\n format.html { redirect_to villages_path, notice: 'Village was successfully created.' }\n format.js { render :js => \"close_modal();refresh_page();\" }\n format.json { render action: 'show', status: :created, location: @village }\n else\n format.html { render action: 'new' }\n format.json { render json: @village.errors, status: :unprocessable_entity }\n format.js\n end\n \n end\n end", "def create\n @user = User.new(user_params)\n respond_to do |format|\n if @user.save\n if params[\"allergens\"] != nil\n params[\"allergens\"].each do |a|\n if Ingredient.find_by_name(a) == nil\n @ingredient = Ingredient.create({:name => a})\n Useringredient.create({:user_id => @user.id, :allergen_id => @ingredient.id})\n else\n @ingredient = Ingredient.find_by_name(a)\n Useringredient.create({:user_id => @user.id, :allergen_id => @ingredient.id})\n end\n end\n end\n session[\"user_id\"] = @user.id\n format.html { redirect_to '/', notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @api_v1_mentorship_interest = Api::V1::MentorshipInterest.new(api_v1_mentorship_interest_params)\n\n respond_to do |format|\n if @api_v1_mentorship_interest.save\n format.html { redirect_to @api_v1_mentorship_interest, notice: 'Mentorship interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentorship_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentorship_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gigapan = Gigapan.new(gigapan_params)\n\n respond_to do |format|\n if @gigapan.save\n format.html { redirect_to @gigapan, notice: 'Gigapan was successfully created.' }\n format.json { render :show, status: :created, location: @gigapan }\n else\n format.html { render :new }\n format.json { render json: @gigapan.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n \t\t\t@penalty = Penalty.new penalty_params\n\n \t\t\tif @penalty.save\n\n \t\t\t\trender json: @penalty,status: :created\n\n \t\t\telse\n\n \t\t\t\trender json: {error: true,errors: @penalty.errors},status: :unprocessable_entity\n\n \t\t\tend\n\n \t\tend", "def create\n @surgery = Surgery.new(params[:surgery])\n\n respond_to do |format|\n if @surgery.save\n format.html { redirect_to @surgery, notice: 'Surgery was successfully created.' }\n format.json { render json: @surgery, status: :created, location: @surgery }\n else\n format.html { render action: \"new\" }\n format.json { render json: @surgery.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n vendor = @quotation.vendor\n @quotation.user = current_user\n\n respond_to do |format|\n unless current_user.quotations_limit_reached?\n # Altera o telefone, data de casamento e numero de convidados, somente quando o usuário não tem os atributos.\n current_user.telephone ||= @quotation.telephone\n current_user.wedding_date ||= @quotation.wedding_date\n current_user.number_guests ||= @quotation.number_guests\n current_user.save\n\n if @quotation.save\n UserMailer.quotation_created(@quotation).deliver\n UserMailer.user_proposal(current_user, @quotation).deliver\n format.html { redirect_to vendor_seo_path(vendor), notice: 'O seu orçamento foi registrado com sucesso.' }\n format.json { render json: @quotation, status: :created, location: @quotation }\n else\n format.html { redirect_to new_quotation_path(:vendor_id => vendor.id) }\n format.json { render json: @quotation.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to vendor_seo_path(vendor), alert: 'Você atingiu o limite diário de orçamentos.' }\n end\n end\n end", "def create\n @generation = Generation.new(generation_params)\n\n respond_to do |format|\n if @generation.save\n format.html { redirect_to [:admin, @generation], notice: 'Generation was successfully created.' }\n format.json { render json: @generation, status: :created, location: @generation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @generation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@lodging = Lodging.new(lodging_params)\n params.permit!\n @lodging = @travel.lodgings.new(params[:lodging])\n\n respond_to do |format|\n if @lodging.save\n #format.html { redirect_to @lodging, notice: 'Lodging was successfully created.' }\n format.html { redirect_to [@travel, @lodging], notice: 'Lodging was successfully created.' }\n format.json { render :show, status: :created, location: @lodging }\n else\n format.html { render :new }\n format.json { render json: @lodging.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipo_agressor = TipoAgressor.new(tipo_agressor_params)\n\n respond_to do |format|\n if @tipo_agressor.save\n format.html { redirect_to @tipo_agressor, notice: @@msgs }\n format.json { render :show, status: :created, location: @tipo_agressor }\n else\n format.html { render :new }\n format.json { render json: @tipo_agressor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if @submission.graded?\n flash[:error] = \"Submission has already been graded by \" + @submission.gradings.last.grader.name\n redirect_to course_assessment_submission_grading_path(@course, @assessment, @submission, @submission.gradings.last)\n return\n end\n\n invalid_assign = false\n @grading.grade = 0\n\n params[:ags].each do |ag|\n @ag = @grading.answer_gradings.build(ag)\n @ag.grader = current_user\n @ag.grader_course = curr_user_course\n unless validate_gradings(@ag, ag)\n invalid_assign = true\n break\n end\n\n @grading.grade += @ag.grade\n end\n\n if @grading.grade > @assessment.max_grade || @grading.exp > @assessment.exp\n invalid_assign = true\n end\n\n @grading.grader = current_user\n @grading.grader_course = curr_user_course\n @grading.student = @submission.std_course\n\n if invalid_assign\n grade_error_response\n elsif @grading.save\n @submission.set_graded\n\n respond_to do |format|\n format.html { redirect_to course_assessment_submission_path(@course, @assessment, @submission),\n notice: \"Grading has been recorded.\" }\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n end\n end\n end", "def create\n @suggested_age = SuggestedAge.new(suggested_age_params)\n\n respond_to do |format|\n if @suggested_age.save\n format.html { \n flash[:notice] = 'La edad sugerida se creó satisfactoriamente.'\n redirect_to suggested_ages_path\n }\n format.json { render :show, status: :created, location: @suggested_age }\n else\n format.html { render :new }\n format.json { render json: @suggested_age.errors, status: :unprocessable_entity }\n end\n end\n end", "def gentre_params\n params.require(:gentre).permit(:name)\n end", "def create\n\n @genu = Genu.new(params[:genu])\n\n respond_to do |format|\n if @genu.save\n format.html { redirect_to control_genus_path,\n notice: t('activerecord.attributes.genu.messages.has_been_success_created') }\n format.json { render json: @genu, status: :created, location: @genu }\n else\n format.html { render action: \"new\" }\n format.json { render json: @genu.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @allergy = Allergy.new(params[:allergy])\n\n respond_to do |format|\n if @allergy.save\n format.html { redirect_to(@allergy, :notice => 'Allergy was successfully created.') }\n format.xml { render :xml => @allergy, :status => :created, :location => @allergy }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @allergy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def garantium_params\n params.require(:garantium).permit(:key, :date)\n end", "def create\n @generation = Generation.new(generation_params)\n\n respond_to do |format|\n if @generation.save\n format.html { redirect_to ['admin', @generation], notice: 'Generación Creada' }\n format.json { render :show, status: :created, location: @generation }\n else\n format.html { render :new }\n format.json { render json: @generation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mentionslegale = Mentionslegale.new(mentionslegale_params)\n\n respond_to do |format|\n if @mentionslegale.save\n format.html { redirect_to @mentionslegale, notice: 'Mentionslegale was successfully created.' }\n format.json { render :show, status: :created, location: @mentionslegale }\n else\n format.html { render :new }\n format.json { render json: @mentionslegale.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n passenger = Passenger.new(:name => params[:name], :contact_number => params[:contact_number], :nationality => params[:nationality], :meal_pref => params[:meal_pref])\n passenger.save\n render :json => passenger\n end", "def create\n @lodgement = Lodgement.new(lodgement_params)\n\n respond_to do |format|\n if @lodgement.save\n format.html { redirect_to @lodgement, notice: 'Lodgement was successfully created.' }\n format.json { render :show, status: :created, location: @lodgement }\n else\n format.html { render :new }\n format.json { render json: @lodgement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grooming = Grooming.new(grooming_params)\n\n respond_to do |format|\n if @grooming.save\n format.html { redirect_to @grooming, notice: 'Visit was successfully created.' }\n format.json { render :show, status: :created, location: @grooming }\n else\n format.html { render :new }\n format.json { render json: @grooming.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gig_set = GigSet.new(gig_set_params)\n @gig_set.number = (@gig_set.gig.gig_sets.map(&:number).compact.max || 0) + 1\n\n respond_to do |format|\n if @gig_set.save\n format.html { redirect_to edit_gig_path(@gig_set.gig) }\n format.json { redirect_to edit_gig_path(@gig_set.gig) }\n else\n format.html { redirect_to edit_gig_path(@gig_set.gig), error: \"Couldn't add a new set\" }\n format.json { redirect_to edit_gig_path(@gig_set.gig), status: :unprocessable_entity }\n end\n end\n end", "def gig_params\n params.require(:gig).permit(:date, :gate_opening, :showtime, :duration, :local, :address, :state, :country, :website, :release)\n end", "def create\n @gravity = Gravity.new(params[:gravity])\n\n respond_to do |format|\n if @gravity.save\n format.html { redirect_to @gravity, notice: 'Gravity was successfully created.' }\n format.json { render json: @gravity, status: :created, location: @gravity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gravity.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gig_request = GigRequest.new(gig_request_params)\n \n #@gig_request.name = encode(@gig_request.name)\n #@gig_request.address = encode(@gig_request.address)\n #@gig_request.email = encode(@gig_request.email)\n\n respond_to do |format|\n if @gig_request.save\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully created.' }\n format.json { render :show, status: :created, location: @gig_request }\n else\n format.html { render :new }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n #flash[:error] = @gig_request.errors.full_messages[0]\n #render 'new'\n end\n end\n end", "def create\n @german_go_league = GermanGoLeague.new(params[:german_go_league])\n\t\t@title = \"Neues Spiel eintragen\" \n \n respond_to do |format|\n if @german_go_league.save\n format.html { redirect_to :action => \"index\" }\n format.json { render json: @german_go_league, status: :created, location: @german_go_league }\n else\n format.html { render action: \"new\" }\n format.json { render json: @german_go_league.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @hot_water_distribution = HotWaterDistribution.new(params[:hot_water_distribution])\n\n respond_to do |format|\n if @hot_water_distribution.save\n format.html { redirect_to @hot_water_distribution, notice: 'Hot water distribution was successfully created.' }\n format.json { render json: @hot_water_distribution, status: :created, location: @hot_water_distribution }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hot_water_distribution.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gin = Gin.new(gin_params)\n if params[:gin][:distillery_id].blank? && params[:distillery_name].present?\n @distillery = Distillery.find_or_create_by(name: params[:distillery_name])\n params[:gin][:distillery_id] = @distillery.id\n end\n\n respond_to do |format|\n if @gin.save\n format.html { redirect_to @gin, notice: 'Gin was successfully created.' }\n format.json { render :show, status: :created, location: @gin }\n else\n format.html { render :new }\n format.json { render json: @gin.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @g_anewby = GAnewbie.new(g_anewby_params)\n\n respond_to do |format|\n if @g_anewby.save\n format.html { redirect_to @g_anewby, notice: 'G anewbie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @g_anewby }\n else\n format.html { render action: 'new' }\n format.json { render json: @g_anewby.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @engagement = current_user.engagements.new(engagement_params_with_school)\n if @engagement.save\n render :show, status: :created, location: api_v2_engagement_url(@engagement)\n else\n puts @engagement.errors.full_messages\n render json: @engagement.errors, status: :unprocessable_entity\n end\n end", "def rigging_params\n params.require(:rigging).permit(:rigging)\n end", "def create\n @engagement = Engagement.new(params[:engagement])\n\n respond_to do |format|\n if @engagement.save\n format.html { redirect_to @engagement, notice: 'Engagement was successfully created.' }\n format.json { render json: @engagement, status: :created, location: @engagement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @engagement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @desgination = Desgination.new(desgination_params)\n\n respond_to do |format|\n if @desgination.save\n format.html { redirect_to @desgination, notice: 'Desgination was successfully created.' }\n format.json { render :show, status: :created, location: @desgination }\n else\n format.html { render :new }\n format.json { render json: @desgination.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @badge = Badge.new(params[:badge])\n\n respond_to do |format|\n if @badge.save\n flash[:notice] = 'Badge was successfully created.'\n format.html { redirect_to organization_segment_badge_url(@organization, @segment, @badge) }\n format.xml { render :xml => @badge, :status => :created, :location => @badge }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @badge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def agglomeration_params\n params.require(:agglomeration).permit(:name)\n end" ]
[ "0.62815017", "0.62179554", "0.6190228", "0.6001416", "0.5924232", "0.5803998", "0.5788219", "0.5759266", "0.57424706", "0.57262695", "0.5717415", "0.57160664", "0.5695696", "0.56330705", "0.5626055", "0.562183", "0.5593575", "0.55877817", "0.5563954", "0.5561194", "0.55527", "0.5518657", "0.55052835", "0.5495099", "0.54938143", "0.5468156", "0.5465658", "0.5449657", "0.5441745", "0.5439456", "0.5434539", "0.5434501", "0.5431979", "0.5429926", "0.54281455", "0.54281455", "0.5398305", "0.53904563", "0.5388792", "0.5384473", "0.5375096", "0.5372551", "0.53690255", "0.53681284", "0.5357652", "0.53500414", "0.533921", "0.53239536", "0.531519", "0.5311535", "0.5300729", "0.5300202", "0.5296724", "0.52944356", "0.5289165", "0.5285346", "0.5280758", "0.52797914", "0.5278583", "0.52776146", "0.52738786", "0.5260451", "0.5256387", "0.5253679", "0.52517253", "0.52514285", "0.5243942", "0.52420276", "0.52397585", "0.5237478", "0.5236688", "0.5233349", "0.52326196", "0.5228631", "0.522477", "0.5223434", "0.5222597", "0.5217479", "0.52094084", "0.5209206", "0.5208513", "0.52065974", "0.5205296", "0.5203375", "0.52005535", "0.5200202", "0.5197232", "0.5192657", "0.5190041", "0.5189288", "0.51882255", "0.5186018", "0.51855254", "0.51837265", "0.5180374", "0.51773953", "0.5174291", "0.5169254", "0.516747", "0.5163927" ]
0.6999638
0
PATCH/PUT /germinations/1 PATCH/PUT /germinations/1.json
def update respond_to do |format| if @germination.update(germination_params) format.html { redirect_to @germination, notice: 'Germination was successfully updated.' } format.json { render :show, status: :ok, location: @germination } else format.html { render :edit } format.json { render json: @germination.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n if @golfer.update_attributes(params[:golfer])\n format.html { redirect_to @golfer, notice: 'Golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @allergy.update(allergy_params)\n format.html { redirect_to @allergy, notice: t('allergies.update_success') }\n format.json { render :show, status: :ok, location: @allergy }\n else\n format.html { render :edit }\n format.json { render json: @allergy.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @feat = @person.feats.find(params[:id])\n level_old = @person.level\n\n if params[:feat][:completed] == '1'\n @feat.complete\n else\n @feat.uncomplete\n end\n sign = params[:feat][:completed] == '1' ? '+': '-'\n \n has_leveled = @person.level > level_old\n\n respond_to do |format|\n format.json { render :json => {\n :xpGained => \"#{sign}#{@feat.xp}\",\n :xpTotal => @person.xp,\n :next_level_ratio => @person.next_level_ratio,\n :extra_life => @person.level_to_string,\n :has_leveled => has_leveled,\n :completed => @feat.completed,\n :streak => @feat.calculate_streak}}\n \n end\n\n end", "def patch!\n request! :patch\n end", "def from_merge_patch_json\n if request.patch?\n from_json\n else\n 415\n end\n end", "def update\n @relatorio_gerals = RelatorioGeral.all\n authorize @relatorio_gerals\n\n respond_to do |format|\n if @relatorio_geral.update(relatorio_geral_params)\n format.html { redirect_to @relatorio_geral, notice: 'Relatório geral atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @relatorio_geral }\n else\n format.html { render :edit }\n format.json { render json: @relatorio_geral.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @meritbadge = Meritbadge.find(params[:id])\n\n respond_to do |format|\n if @meritbadge.update_attributes(params[:meritbadge])\n format.html { redirect_to(@meritbadge, :notice => 'Meritbadge was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @meritbadge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @gig_request = GigRequest.find(params[:id])\n\n respond_to do |format|\n if @gig_request.update_attributes(params[:gig_request])\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bracket_golfer.update(bracket_golfer_params)\n format.html { redirect_to @bracket_golfer, notice: 'Bracket golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @freerange.update(freerange_params)\n format.html { redirect_to current_user }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @freerange.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @garrison.update(garrison_params)\n format.html { redirect_to @garrison, notice: 'Garrison was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @garrison.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gentre.update(gentre_params)\n format.json { render :show, status: :ok, location: @gentre }\n else\n format.json { render json: @gentre.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @badge = Badge.find(params[:id])\n\n respond_to do |format|\n if @badge.update_attributes(params[:badge])\n format.html { redirect_to @badge, notice: 'Badge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @badge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @allergens_ingredient.update(allergens_ingredient_params)\n format.html { redirect_to @allergens_ingredient, notice: 'Allergens ingredient was successfully updated.' }\n format.json { render :show, status: :ok, location: @allergens_ingredient }\n else\n format.html { render :edit }\n format.json { render json: @allergens_ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @allergy = Allergy.find(params[:id])\n\n respond_to do |format|\n if @allergy.update_attributes(params[:allergy])\n format.html { redirect_to(@allergy, :notice => 'Allergy was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @allergy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch\n end", "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe.allergies.destroy_all\n params[:recipe][:allergy].each do |key,value|\n if value[\"name\"] == \"1\"\n allergy = Allergy.find(key)\n @recipe.allergies << allergy\n end\n end\n\n if params[:recipe][:concentrate] == '1' || params[:recipe][:recipe_category_id] == RecipeCategory.find_by(name: \"Concentrates\").id\n @recipe.concentrate = true\n else\n @recipe.concentrate = false\n end\n\n respond_to do |format|\n if @recipe.update(recipe_params)\n @allergies = Allergy.all\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n @allergies = Allergy.all\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mineral = Mineral.find(params[:id])\n \n respond_to do |format|\n if @mineral.update_attributes(params[:mineral])\n format.html { redirect_to @mineral, notice: 'Mineral was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mineral.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def update\n respond_to do |format|\n if @mineral.update(mineral_params)\n format.html { redirect_to @mineral, notice: 'Mineral actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mineral.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @galletum.update(galletum_params)\n format.html { redirect_to @galletum, notice: 'Galletum was successfully updated.' }\n format.json { render :show, status: :ok, location: @galletum }\n else\n format.html { render :edit }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n logger.info('PUT Update:')\n logger.info(request_body)\n new_pub = hashed_request\n old_pub = Publication.find_by(id: params[:id])\n if old_pub.blank?\n head :not_found\n return\n elsif old_pub.deleted?\n head :gone\n return\n end\n if old_pub.harvested_pub? # only manually entered (i.e. non-harvested) publications may be updated with this method\n render json: {\n error: \"This record SulPubID #{old_pub.id} may not be modified. If you had originally entered details for the record, \" \\\n 'it has been superceded by a central record.'\n },\n status: :forbidden, format: 'json'\n return\n elsif !validate_or_create_authors(new_pub[:authorship])\n render json: { error: 'You have not supplied a valid authorship record.' }, status: :not_acceptable,\n format: 'json'\n return\n end\n logger.info(\"Update manual publication #{old_pub.inspect} with BibJSON:\")\n logger.info(request_body)\n old_pub.update_manual_pub_from_pub_hash(new_pub, request_body)\n old_pub.save!\n old_pub.reload\n logger.debug(\"resulting pub hash: #{old_pub.pub_hash}\")\n render json: old_pub.pub_hash, status: :accepted\n end", "def update\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n if @gauge.update_attributes(params[:gauge])\n format.html { redirect_to @gauge, notice: 'Gauge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rigging.update(rigging_params)\n format.html { redirect_to @rigging, notice: 'Rigging was successfully updated.' }\n format.json { render :show, status: :ok, location: @rigging }\n else\n format.html { render :edit }\n format.json { render json: @rigging.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @garply.update(garply_params)\n format.html { redirect_to @garply, notice: 'Garply was successfully updated.' }\n format.json { render :show, status: :ok, location: @garply }\n else\n format.html { render :edit }\n format.json { render json: @garply.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n if @gopy.update_attributes(params[:gopy])\n format.html { redirect_to @gopy, notice: 'Gopy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gopy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gig_request.update(gig_request_params)\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully updated.' }\n format.json { render :show, status: :ok, location: @gig_request }\n else\n format.html { render :edit }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @badge = Badge.find(params[:id])\n respond_to do |format|\n if @badge.update_attributes(params[:badge])\n flash[:notice] = 'Badge was successfully updated.'\n format.html { redirect_to organization_segment_badge_url(@organization,@segment, @badge) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @badge.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @incrustation.update(incrustation_params)\n record_activity(@incrustation)\n format.html { redirect_to admin_incrustations_path, notice: 'Вставка была успешно обновлена.' }\n format.json { render :show, status: :ok, location: @incrustation }\n else\n format.html { render :edit }\n format.json { render json: @incrustation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative_field.update(api_v1_initiative_field_params)\n format.html { redirect_to @api_v1_initiative_field, notice: 'Initiative field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_field.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #respond_to do |format|\n if @allergen.update(allergen_params)\n #format.html { redirect_to @allergen, notice: 'Allergen was successfully updated.' }\n #format.json { render :show, status: :ok, location: @allergen }\n render :show, status: :ok, location: @allergen\n else\n #format.html { render :edit }\n #format.json { render json: @allergen.errors, status: :unprocessable_entity }\n render json: @allergen.errors, status: :unprocessable_entity\n end\n #end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n if @gethotel.update_attributes(params[:gethotel])\n format.html { redirect_to @gethotel, notice: 'Gethotel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gethotel.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @fridge = Fridge.find(params[:id])\n\n respond_to do |format|\n if @fridge.update_attributes(params[:fridge])\n format.html { redirect_to @fridge, notice: 'Fridge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fridge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @alligator.update(alligator_params)\n format.html { redirect_to @alligator, notice: 'Alligator was successfully updated.' }\n format.json { render :show, status: :ok, location: @alligator }\n else\n format.html { render :edit }\n format.json { render json: @alligator.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @minister.update(minister_params)\n format.html { redirect_to @minister, notice: 'Minister was successfully updated.' }\n format.json { render :show, status: :ok, location: @minister }\n else\n format.html { render :edit }\n format.json { render json: @minister.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n if @gage.update_attributes(params[:gage])\n format.html { redirect_to @gage, notice: 'Gage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch; end", "def patch; end", "def update\n respond_to do |format|\n if @api_v1_mentorship_interest.update(api_v1_mentorship_interest_params)\n format.html { redirect_to @api_v1_mentorship_interest, notice: 'Mentorship interest was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_mentorship_interest }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_mentorship_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, **args); end", "def update\n @messege = Messege.find(params[:id])\n\n respond_to do |format|\n if @messege.update_attributes(params[:messege])\n format.html { redirect_to @messege, notice: 'Messege was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @messege.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gonullu.update(gonullu_params)\n format.html { redirect_to @gonullu, notice: 'Gonullu was successfully updated.' }\n format.json { render :show, status: :ok, location: @gonullu }\n else\n format.html { render :edit }\n format.json { render json: @gonullu.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @growth.update(growth_params)\n format.html { redirect_to @growth, notice: 'Growth was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @growth.errors, status: :unprocessable_entity }\n end\n end\n end", "def bump_patch\n @patch += 1\n self.save\n end", "def update\n @glass = Glass.find(params[:id])\n\n respond_to do |format|\n if @glass.update_attributes(params[:glass])\n format.html { redirect_to @glass, notice: 'Glass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @glass.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @legs2.update(legs2_params)\n format.html { redirect_to \"/legs2s\"}\n format.json { render :show, status: :ok, location: @legs2 }\n else\n format.html { render :edit }\n format.json { render json: @legs2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @lager.update(lager_params)\n format.html { redirect_to @lager, notice: 'Lager was successfully updated.' }\n format.json { render :show, status: :ok, location: @lager }\n else\n format.html { render :edit }\n format.json { render json: @lager.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @order_allergy.update(order_allergy_params)\n format.html { redirect_to @order_allergy, notice: 'Order allergie was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_allergy }\n else\n format.html { render :edit }\n format.json { render json: @order_allergy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @soldier = Soldier.find(params[:id])\n\n respond_to do |format|\n if @soldier.update_attributes(params[:soldier])\n # clear the cache files so the new data is avaialble\n JsonCache.clear\n\n format.html { redirect_to admin_soldier_path(@soldier), notice: t('app.msgs.success_created', :obj => t('activerecord.models.soldier')) }\n format.json { head :ok }\n else\n gon.edit_soldier = true\n#\t\t gon.born_at = @soldier.born_at.strftime('%m/%d/%Y') if @soldier.born_at.present?\n\t\t gon.died_at = @soldier.died_at.strftime('%m/%d/%Y') if @soldier.died_at.present?\n format.html { render action: \"edit\" }\n format.json { render json: @soldier.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gang.update(gang_params)\n format.html { redirect_to @gang, notice: 'Gang was successfully updated.' }\n format.json { render :show, status: :ok, location: @gang }\n else\n format.html { render :edit }\n format.json { render json: @gang.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @mercurial.update(mercurial_params)\n format.html { redirect_to @mercurial, notice: 'Mercurial was successfully updated.' }\n format.json { render :show, status: :ok, location: @mercurial }\n else\n format.html { render :edit }\n format.json { render json: @mercurial.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @garrage.update(garrage_params)\n format.html { redirect_to @garrage, notice: 'Garrage was successfully updated.' }\n format.json { render :show, status: :ok, location: @garrage }\n else\n format.html { render :edit }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_allergy.update(user_allergy_params)\n format.html { redirect_to @user_allergy, notice: 'User allergie was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_allergy }\n else\n format.html { render :edit }\n format.json { render json: @user_allergy.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def update\n @enhancement = Enhancement.find(params[:id])\n\n respond_to do |format|\n if @enhancement.update_attributes(params[:enhancement])\n format.html { redirect_to @enhancement, notice: 'Enhancement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enhancement.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @golf.update(golf_params)\n format.html { redirect_to @golf, notice: 'Golf was successfully updated.' }\n format.json { render :show, status: :ok, location: @golf }\n else\n format.html { render :edit }\n format.json { render json: @golf.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_germination\n @germination = Germination.find(params[:id])\n end", "def update\n respond_to do |format|\n if @elder_gallary.update(elder_gallary_params)\n format.html { redirect_to @elder_gallary, notice: 'Elder gallary was successfully updated.' }\n format.json { render :show, status: :ok, location: @elder_gallary }\n else\n format.html { render :edit }\n format.json { render json: @elder_gallary.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @badge.update(badge_params)\n format.html { redirect_to @badge, notice: 'Badge was successfully updated.' }\n format.json { render :show, status: :ok, location: @badge }\n else\n format.html { render :edit }\n format.json { render json: @badge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if @penalty.update(penalty_params)\n\n render json: @penalty,status: :ok\n\n else\n\n render json: {error: true,errors: @penalty.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def update\n respond_to do |format|\n save_relations\n if @ingredient.update(ingredient_params)\n format.html { redirect_to @ingredient.recipe, notice: 'Ingredient was successfully updated.' }\n format.json { render :show, status: :ok, location: @ingredient }\n else\n format.html { render :edit }\n format.json { render json: @ingredient.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @gig_set.update(gig_set_params)\n format.html { redirect_to edit_gig_path(@gig_set.gig) }\n format.json { redirect_to edit_gig_path(@gig_set.gig) }\n else\n format.html { redirect_to edit_gig_path(@gig_set.gig), error: \"Couldn't update set\" }\n format.json { redirect_to edit_gig_path(@gig_set.gig), status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end", "def update\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n if @grm_grappt.update_attributes(params[:grm_grappt])\n format.html { redirect_to @grm_grappt, notice: 'Grooming appointment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grm_grappt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end", "def update\n respond_to do |format|\n if @made_in_g.update(made_in_g_params)\n format.html { redirect_to @made_in_g, notice: 'Made in g was successfully updated.' }\n format.json { render :show, status: :ok, location: @made_in_g }\n else\n format.html { render :edit }\n format.json { render json: @made_in_g.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # if @bonus.update(bonus_params)\n # render :show, status: :ok, location: @bonus\n # else\n # render json: @bonus.errors, status: :unprocessable_entity\n # end\n end", "def update\n respond_to do |format|\n if @grumble.update(grumble_params)\n format.html { redirect_to @grumble, notice: 'Grumble was successfully updated.' }\n format.json { render :show, status: :ok, location: @grumble }\n else\n format.html { render :edit }\n format.json { render json: @grumble.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n if update_gig(@gig)\n format.html { redirect_to @gig, notice: 'Gig was successfully updated.' }\n format.json { render json: @gig, status: :ok, location: @gig }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end", "def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end", "def update\n respond_with []\n end", "def update\n #respond_to do |format|\n # if @request.update(request_params)\n # format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: 'edit' }\n # format.json { render json: @request.errors, status: :unprocessable_entity }\n # end\n #end\n end", "def update\n respond_to do |format|\n if @lounge.update(lounge_params)\n format.html { redirect_to @lounge, notice: 'Lounge was successfully updated.' }\n format.json { render :show, status: :ok, location: @lounge }\n else\n format.html { render :edit }\n format.json { render json: @lounge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @fucker = Fucker.find(params[:id])\n\n respond_to do |format|\n if @fucker.update_attributes(params[:fucker])\n format.json { head :no_content }\n else\n format.json { render json: @fucker.errors, status: :internal_server_error }\n end\n end\n end", "def update!(**args)\n @modifications = args[:modifications] if args.key?(:modifications)\n end", "def update\n respond_to do |format|\n if @major.update(major_params)\n format.html { redirect_to @major, notice: 'Major was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @major.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @regulation = Regulation.find(params[:id])\n\n respond_to do |format|\n if @regulation.update_attributes(params[:regulation])\n format.html { redirect_to @regulation, notice: 'Regulation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @regulation.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n respond_to do |format|\n if @aggrupation.update(aggrupation_params)\n format.html { redirect_to @aggrupation, notice: 'Aggrupation was successfully updated.' }\n format.json { render :show, status: :ok, location: @aggrupation }\n else\n format.html { render :edit }\n format.json { render json: @aggrupation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @hoge = Hoge.find(params[:id])\n\n respond_to do |format|\n if @hoge.update_attributes(params[:hoge])\n format.html { redirect_to @hoge, notice: 'Hoge was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hoge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @gig.update(gig_params)\n format.html { redirect_to @gig, notice: \"Gig was successfully updated.\" }\n format.json { render :show, status: :ok, location: @gig }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.62286437", "0.6133187", "0.60811967", "0.6075552", "0.60667264", "0.60458076", "0.59186405", "0.58900356", "0.58647126", "0.5864348", "0.58479387", "0.58449566", "0.5818425", "0.58170277", "0.58123165", "0.5799829", "0.5795953", "0.57946986", "0.57925326", "0.5792086", "0.5790806", "0.5783501", "0.5772336", "0.57651895", "0.57621104", "0.57440585", "0.57433385", "0.57397735", "0.57297844", "0.57234085", "0.5710138", "0.57084024", "0.57074904", "0.5703385", "0.57013583", "0.5676748", "0.566603", "0.56644887", "0.5660983", "0.56569207", "0.5654552", "0.5652381", "0.5647217", "0.5626671", "0.5626543", "0.56248945", "0.5617559", "0.5617559", "0.5617156", "0.5617156", "0.56130165", "0.5609383", "0.5608294", "0.5602205", "0.56006384", "0.56006175", "0.55965817", "0.55963326", "0.55903953", "0.55795044", "0.5574842", "0.5572973", "0.556952", "0.5564392", "0.5563787", "0.55637115", "0.55637115", "0.5559915", "0.5559748", "0.5554993", "0.5554527", "0.55543864", "0.55516726", "0.55436414", "0.5542119", "0.55387163", "0.55387163", "0.55387163", "0.55387163", "0.55367637", "0.55367273", "0.5535161", "0.5533949", "0.5532708", "0.5532599", "0.5520176", "0.551703", "0.55169284", "0.5513026", "0.551296", "0.55129427", "0.5510748", "0.5506918", "0.55027264", "0.5497681", "0.5497372", "0.5496964", "0.5492697", "0.5490589", "0.5480892" ]
0.65737003
0
DELETE /germinations/1 DELETE /germinations/1.json
def destroy begin @germination.destroy respond_to do |format| format.html { redirect_to germinations_url, notice: 'Germination was successfully destroyed.' } format.json { head :no_content } end rescue ActiveRecord::DeleteRestrictionError => e respond_to do |format| format.html {redirect_to germinations_url, alert: "#{e}"} end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @golfer = Golfer.find(params[:id])\n @golfer.destroy\n\n respond_to do |format|\n format.html { redirect_to golfers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mineral.destroy\n respond_to do |format|\n format.html { redirect_to minerals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gentre.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @allergy.destroy\n respond_to do |format|\n format.html { redirect_to allergies_url, notice: t('allergies.destroy_success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @gauge = Gauge.find(params[:id])\n @gauge.destroy\n\n respond_to do |format|\n format.html { redirect_to gauges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @lounge.destroy\n respond_to do |format|\n format.html { redirect_to lounges_url, notice: 'Lounge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @incrustation_tmp = @incrustation.dup\n @incrustation.destroy\n record_activity(@incrustation_tmp)\n respond_to do |format|\n format.html { redirect_to admin_incrustations_url, notice: 'Вставка была успешно удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rigging.destroy\n respond_to do |format|\n format.html { redirect_to riggings_url, notice: 'Rigging was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @allergen.destroy\n respond_to do |format|\n #format.html { redirect_to allergens_url, notice: 'Allergen was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @garrison.destroy\n respond_to do |format|\n format.html { redirect_to garrisons_path_for(@garrison) }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @bracket_golfer.destroy\n respond_to do |format|\n format.html { redirect_to bracket_golfers_url }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @immigrant = Immigrant.find(params[:id])\n @immigrant.destroy\n\n respond_to do |format|\n format.html { redirect_to immigrants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stilage.destroy\n respond_to do |format|\n format.html { redirect_to stilages_url, notice: 'Stilage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gig_request = GigRequest.find(params[:id])\n @gig_request.destroy\n\n respond_to do |format|\n format.html { redirect_to gig_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galletum.destroy\n respond_to do |format|\n format.html { redirect_to galleta_url, notice: 'Galletum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to(organization_segment_badges_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @gang.destroy\n respond_to do |format|\n format.html { redirect_to gangs_url, notice: 'Gang was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @generation.destroy\n respond_to do |format|\n format.html { redirect_to generations_my_url, notice: 'Сгенерированные варианты были успешно удалены.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @d_dungeoneer.destroy\n respond_to do |format|\n format.html { redirect_to d_dungeoneers_url, notice: 'D dungeoneer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @aggrupation.destroy\n respond_to do |format|\n format.html { redirect_to aggrupations_url, notice: 'Aggrupation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to badges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @meritbadge = Meritbadge.find(params[:id])\n @meritbadge.destroy\n\n respond_to do |format|\n format.html { redirect_to(meritbadges_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @grumble.destroy\n respond_to do |format|\n format.html { redirect_to grumbles_url, notice: 'Grumble was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @relatorio_gerals = RelatorioGeral.all\n authorize @relatorio_gerals\n\n @relatorio_geral.destroy\n respond_to do |format|\n format.html { redirect_to relatorio_gerals_url, notice: 'Relatório geral deletado com sucesso!' }\n format.json { head :no_content }\n end\n end", "def destroy\n Generator.where(id: params[:id] ).first.destroy\n respond_to do |format|\n format.html { redirect_to generators_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hoge = Hoge.find(params[:id])\n @hoge.destroy\n\n respond_to do |format|\n format.html { redirect_to hoges_url }\n format.json { head :ok }\n end\n end", "def destroy\n @generation = Generation.find(params[:id])\n @generation.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_generations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @allergens_ingredient.destroy\n respond_to do |format|\n format.html { redirect_to allergens_ingredients_url, notice: 'Allergens ingredient was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gastracker = Gastracker.find(params[:id])\n @gastracker.destroy\n\n respond_to do |format|\n format.html { redirect_to gastrackers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @galeria = Galeria.find(params[:id])\n @galeria.destroy\n\n respond_to do |format|\n format.html { redirect_to galerias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @degre.destroy\n respond_to do |format|\n format.html { redirect_to degres_url, notice: 'Degre was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @garply.destroy\n respond_to do |format|\n format.html { redirect_to garplies_url, notice: 'Garply was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @crag.destroy\n respond_to do |format|\n format.html { redirect_to crags_url, notice: 'Crag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gl.destroy\n respond_to do |format|\n format.html { redirect_to gls_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @uder.destroy\n respond_to do |format|\n format.html { redirect_to uders_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @allergy = Allergy.find(params[:id])\n @allergy.destroy\n\n respond_to do |format|\n format.html { redirect_to(allergies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @geocach = Geocach.find(params[:id])\n @geocach.destroy\n\n respond_to do |format|\n format.html { redirect_to geocaches_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @garantium.destroy\n respond_to do |format|\n format.html { redirect_to garantia_url, notice: 'Garantium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gran_unidad.destroy\n respond_to do |format|\n format.html { redirect_to gran_unidad_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gig = Gig.find(params[:id])\n @gig.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { render json: nil, status: :ok }\n end\n end", "def destroy\n @gig_request.destroy\n respond_to do |format|\n format.html { redirect_to gig_requests_url, notice: 'Gig request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gopy = Gopy.find(params[:id])\n @gopy.destroy\n\n respond_to do |format|\n #format.html { redirect_to gopies_url }\n format.html { redirect_to hienthi_gopies_path }\n format.json { head :no_content }\n end\n end", "def destroy\n #add admin check here!\n @diner.destroy\n respond_to do |format|\n format.html { redirect_to diners_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gage = Gage.find(params[:id])\n @gage.destroy\n\n respond_to do |format|\n format.html { redirect_to gages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @alligator.destroy\n respond_to do |format|\n format.html { redirect_to alligators_url, notice: 'Alligator was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gatha.destroy\n respond_to do |format|\n format.html { redirect_to gathas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gatineo.destroy\n respond_to do |format|\n format.html { redirect_to gatineos_url, notice: 'Gatineo apagado com sucesso!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @mercadorium.destroy\n respond_to do |format|\n format.html { redirect_to mercadoria_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gin.destroy\n respond_to do |format|\n format.html { redirect_to gins_url, notice: 'Gin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @small_generator = SmallGenerator.find(params[:id])\n @small_generator.destroy\n\n respond_to do |format|\n format.html { redirect_to small_generators_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mercurial.destroy\n respond_to do |format|\n format.html { redirect_to mercurials_url, notice: 'Mercurial was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @general_ledger.destroy\n respond_to do |format|\n format.html { redirect_to general_ledgers_url, notice: 'General ledger was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grooming.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Visit was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @legs2.destroy\n respond_to do |format|\n format.html { redirect_to legs2s_url, notice: 'Legs2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gig.destroy\n respond_to do |format|\n format.html { redirect_to gigs_url, notice: 'Gig was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_village = Admin::Village.find(params[:id])\n @admin_village.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_villages_url }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @fridge = Fridge.find(params[:id])\n @fridge.destroy\n\n respond_to do |format|\n format.html { redirect_to fridges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_merge.destroy\n respond_to do |format|\n format.html { redirect_to admin_merges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @gig.destroy\n respond_to do |format|\n format.html { redirect_to gigs_url, notice: \"Gig was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @gastronomium.destroy\n respond_to do |format|\n format.html { redirect_to gastronomia_url, notice: 'Gastronomium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @lodging.destroy\n respond_to do |format|\n format.html { redirect_to lodgings_url, notice: 'Lodging was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @alumno.destroy\n respond_to do |format|\n format.html { redirect_to grupos_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @lodging.destroy\n respond_to do |format|\n format.html { redirect_to lodgings_url, notice: \"Lodging was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @gethotel = Gethotel.find(params[:id])\n @gethotel.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotels_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @updaterete = Updaterete.find(params[:id])\n @updaterete.destroy\n\n respond_to do |format|\n format.html { redirect_to updateretes_url }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def destroy\n @agencium.destroy\n respond_to do |format|\n format.html { redirect_to agencia_url, notice: 'Agencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hydrant = Hydrant.find(params[:id])\n @hydrant.destroy\n\n respond_to do |format|\n format.html { redirect_to(hydrants_url) }\n format.xml { head :ok }\n end\n end", "def destroy\r\n checar_egresso_super\r\n @egresso.destroy\r\n respond_to do |format|\r\n format.html { redirect_to egressos_url, notice: 'Egresso excluído com sucesso.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @early_access_request.destroy\n respond_to do |format|\n format.html { redirect_to early_access_requests_url, notice: 'Anfrage wurde gelöscht.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @unlimited.destroy\n respond_to do |format|\n format.html { redirect_to unlimiteds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @grupa = Grupa.find(params[:id])\n @grupa.destroy\n\n respond_to do |format|\n format.html { redirect_to grupy_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @herald.destroy\n respond_to do |format|\n format.html { redirect_to heralds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @patron_merge.destroy\n\n respond_to do |format|\n format.html { redirect_to(patron_merges_url) }\n format.json { head :no_content }\n end\n end", "def destroy\n @admintreatmentfumigation.destroy\n respond_to do |format|\n format.html { redirect_to admintreatmentfumigations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @minister.destroy\n respond_to do |format|\n format.html { redirect_to ministers_url, notice: 'Minister was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @elder_gallary.destroy\n respond_to do |format|\n format.html { redirect_to elder_gallaries_url, notice: 'Elder gallary was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gudang.destroy\n respond_to do |format|\n format.html { redirect_to gudangs_url, notice: 'Gudang was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @galinha.destroy\n respond_to do |format|\n format.html { redirect_to galinhas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @badge.destroy\n respond_to do |format|\n format.html { redirect_to badges_url, notice: 'Badge was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @betraege = Betraege.find(params[:id])\n @betraege.destroy\n\n respond_to do |format|\n format.html { redirect_to betraeges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @surgery = Surgery.find(params[:id])\n @surgery.destroy\n\n respond_to do |format|\n format.html { redirect_to surgeries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @g_anewby.destroy\n respond_to do |format|\n format.html { redirect_to g_anewbies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @checklisten_vorlage.destroy\n respond_to do |format|\n format.html { redirect_to checklisten_vorlages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_v1_initiative_update.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_initiative_updates_url, notice: 'Initiative update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rebate = Rebate.find(params[:id])\n @rebate.destroy\n\n respond_to do |format|\n format.html { redirect_to rebates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bergain = Bergain.find(params[:id])\n @bergain.destroy\n\n respond_to do |format|\n format.html { redirect_to bergains_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.65731776", "0.65606797", "0.65290964", "0.6449913", "0.64485663", "0.6417969", "0.64070225", "0.6393848", "0.638985", "0.63858825", "0.63834727", "0.6381429", "0.63799417", "0.63715047", "0.6367167", "0.63553685", "0.6352163", "0.63477576", "0.6344742", "0.6330198", "0.6322556", "0.6319026", "0.6318108", "0.6317658", "0.6313033", "0.6311225", "0.6310605", "0.62988144", "0.62975806", "0.6289735", "0.62879544", "0.62871706", "0.62855136", "0.62843806", "0.6276554", "0.6275014", "0.62713516", "0.62689334", "0.6261825", "0.6259909", "0.6250914", "0.62487787", "0.6244368", "0.6238359", "0.62364", "0.6235053", "0.6226275", "0.6221725", "0.6217054", "0.62159634", "0.62159425", "0.6208737", "0.62084347", "0.62021685", "0.6200619", "0.6199779", "0.61879116", "0.6187775", "0.6184468", "0.6179087", "0.6176147", "0.6175792", "0.6175034", "0.6173834", "0.6173359", "0.6171655", "0.6170478", "0.6170309", "0.6163263", "0.61620575", "0.6159889", "0.6158016", "0.6157272", "0.6156906", "0.61559755", "0.6155727", "0.6152996", "0.61514926", "0.6150123", "0.6149322", "0.61487055", "0.6145093", "0.6135666", "0.6134656", "0.6133926", "0.61283106", "0.61281234", "0.612676", "0.6126388", "0.6123001", "0.6120958", "0.6120958", "0.61207986", "0.61205995", "0.6119616", "0.6113563", "0.61104685", "0.61083204", "0.610583", "0.61056215" ]
0.64353764
5
Use callbacks to share common setup or constraints between actions.
def set_germination @germination = Germination.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def germination_params params.require(:germination).permit(:seed_id, :week, :numGerminations,:codeCross, :codeCrossNumRepeat, :totalNumRepeat, :totalCode, :missingSeed) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: Takes a string and break up white and put into an array. (array.split) Iterate through each element of the string and use them as keys. Each step of the items: Incrementing the value of the key. Till we reach the end of that list. keys = item , value = quantity. print the list to the console [can you use one of your other methods here?] output: [what data type goes here, array or hash?]
def list_creater(items) my_array = items.split(" ") my_list = Hash.new(0) my_array.each {|item| my_list[item] += 1} return my_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createlist(str)\r\n# steps:\r\n# break the string into an array\r\n items = str.split\r\n item_list = {}\r\n\r\n\t# iterate through array and build hash\r\n items.each do |item|\r\n\r\n\t\t# iterate through array and build hash\r\n\t\t# set default quantity to 1\r\n \titem_list[item] = 1\r\n end\r\n # print the list to the console [the last method that print a list and make it look pretty]\r\n print_list(item_list)\r\n\r\n # output: the hash\r\n return item_list\r\nend", "def list_of_items(userinput)\n itemlist = []\n final_list = {}\n itemlist = userinput.split(' ')\n p itemlist\n quantity = 1\n itemlist.each do |value|\n final_list[value] = 1\n end\n puts final_list\n final_list\nend", "def create_list_items(input_string)\n \n hsh = {}\n \n # create an array containing each item \n array_input = input_string.split(' ')\n \n # create a hash from the array (iterate), containing the information of key/value pairs \n array_input.each do |item|\n # set default quantity as value\n hsh[item] = 0\n end \n \n # print the list to the console (we will use the last method)\n print_list(hsh)\n \n # output: hash data structure of key/value pairs\n return hsh\nend", "def create_list(string)\n list = string.split(' ')\n qty = 1\n grocery_list = {}\n list.each { |item| grocery_list[item] = qty }\n grocery_list\nend", "def create_a_list(string_of_items)\n qty = 1\n grocery_hash = Hash.new\n string_of_items.split(\" \").each do |x|\n grocery_hash[x] = qty\n end\n grocery_hash\nend", "def initial_list(string_of_items)\n grocery_list = {}\n quantity = 1\n items_array = string_of_items.split(\" \")\n items_array.each do |item|\n grocery_list.store(item, quantity)\n end\n grocery_list\nend", "def create_list(items_string, quantity = 0)\n list = {}\n items = items_string.split(\" \")\n items.each do |item|\n list[item] = quantity\n end\n list\nend", "def create_list(items, qty=1)\n items = items.split(\" \")\n list = Hash.new\n\n items.each do |item|\n if list.has_key?(item)\n list[item] += qty\n elsif\n list[item] = qty\n end\n end\n\n return list.each {|k,v| puts \"#{k}: #{v}\"}\nend", "def shopping_list(string)\n\tgrocery_list = {}\n# steps: \n \t# separate string into array\n\tarray = string.split(' ')\n\t# loop through array to create hash with items in array as key and set default quantity to \"\"\n\tarray.map {|item| grocery_list[item] = \"\"}\n\t# print the list to the console [can you use one of your other methods here?]\n\t# output: [what data type goes here, array or hash?]\n\tputs grocery_list\n\treturn grocery_list\nend", "def grocery_list(grocery_items)\n # input: string of items separated by spaces (example: \"carrots apples cereal pizza\") \n # steps: \n # Create a new empty data structure (Hash) \n grocery = {}\n # Convert the string parameter into an array of words.\n item = grocery_items.split(\" \")\n # Iterate through the array and get the element.\n item.each do |product|\n # Store the element as a key in the hash.\n # set default quantity an integer with value 3. This is the default value of the keys in the hash.\n grocery[product] = 3\n display_list(grocery)\n end\n # print the list to the console [can you use one of your other methods here?]\n # output: Hash \n grocery\nend", "def create_list(string_of_items)\n grocery_list = {}\n grocery_items = string_of_items.split\n grocery_items.each do |item, quantity|\n grocery_list[item] = 1\n end \n return grocery_list\nend", "def create_list(input)\n grocery_list = {}\n # convert items in string to hash keys:\n input_array = input.split\n # convert string into array using\n # iterate through array assign each string item to a hash key with default value of x\n # set default quantity\n # iteration loop\n # grocery_list[\"key_name1\"] => 3\n input_array.each do |i|\n grocery_list[i] = 3\n end\n # print the list to the console [can you use one of your other methods here?]\n # call the method for printing a list *below*\n # output: [what data type goes here, array or hash?]\n # make output return hash\n # grocery_list, call the hash so that the last evaluated item is the hash.. and then that is returned\n grocery_list\nend", "def create_list(items_string)\r\n\tdefault_quantity = 1\r\n\r\n\tgrocery_list = Hash.new{|hash, key| hash[key] = default_quantity}\r\n\titems_array = items_string.split(\" \")\r\n\t\r\n\titems_array.each do |item| \r\n\t\tgrocery_list[item.to_sym]\r\n\tend\r\n\tprint_list(grocery_list)\r\n\tgrocery_list\r\nend", "def add_multiple(string,string_q, hash)\n quantity = string_q.split(\" \")\n n = 0\n string.split(\" \").each do |food|\n add(food, quantity[n], hash)\n n = n + 1\n end\nend", "def create_items(string)\r\n item_list = {}\r\n string.split(\" \").each { |item| item_list[item] = 1 }\r\n item_list\r\nend", "def grocery_list(items)\n list = {}\n items.split.each do |item, quantity|\n list[item] = 0\n end\n p list\nend", "def hash_start(food, quantity=1)\n\tgrocery_list = {}\n\n\tfood.split.each { |item| grocery_list[item] = quantity }\n\t\t\n\tgrocery_list\nend", "def create_list(string)\n item_array = string.split(\" \")\n shopping_list = {}\n item_array.each do |item|\n shopping_list[item] = 1\n end\n list_print(shopping_list)\n shopping_list\nend", "def make_list(item_string = \"\")\r\n grocery_list = {}\r\n=begin\r\n items_array = item_string.split(\" \")\r\n #puts items_array\r\n\r\n items_array.each do |shopping_item|\r\n grocery_list[shopping_item] = 1\r\n end\r\n=end\r\n grocery_list = Hash[item_string.split(\" \").map {|item| [item, 1]}] \r\n #I think this is less readable, but i wanted to find another way to do it\r\n #puts grocery_list\r\n return grocery_list \r\nend", "def create_grocery_list(shopping_items)\n # steps:\n # create an empty hash\n grocery_list = {}\n # add items\n # convert input into separate items\n shopping_items = shopping_items.split\n # add items to hash and set default quantity\n shopping_items.each do |item_name|\n grocery_list[item_name.to_sym] = 1\n end\n # print the list to the console [can you use one of your other methods here?]\n print_grocery_list(grocery_list)\n# output: explicit return the hash\n grocery_list\nend", "def create_list(items)\n hash = Hash.new(0)\n items.split(\" \").each do |item|\n hash[item] += 1\n end\n p hash\nend", "def create_list(string)\r\n\tshopping_list = {}\r\n\tshopping_array = string.split(' ')\r\n\tshopping_array.each do |item|\r\n\t\tshopping_list[item] = 1\r\n\tend\r\n\tshopping_list\r\nend", "def groceries(string)\n shopping = {}\n items = string.split(' ')\n items.each {|item| shopping[item] = 1}\n p shopping\nend", "def create_list(user_list)\n# input: string of items separated by spaces (example: \"carrots apples cereal pizza\")\n# puts \"\"\n# steps:\n # [fill in any steps here]\n list_array = user_list.split(\",\")\n # set default quantity\n quanity = 1\n # print the list to the console [can you use one of your other methods here?]\n p list_array.collect { |item| [item, quanity] }\n $list_hash = Hash[list_array.collect { |item| [item, quanity] } ]\n# output: [what data type goes here, array or hash?] Print result in hash\n p $list_hash\n $list_hash\nend", "def create_list(items)\n\tlist = {}\n\titems = items.split(' ')\n\tquantity = 0\n\tlist = Hash.new\n\n\titems.each do |item| \n\t\tlist[item] = quantity\n\tend\n\tlist\nend", "def groceries(string)\r\n shopping = {}\r\n items = string.split(' ')\r\n items.each {|item| shopping[item] = 1}\r\n p shopping\r\nend", "def create_list(string)\n\titems = string.split(\" \")\n\tlist = {}\n\titems.each do |key|\n\t\tif list.keys.include?(key)\n\t\t\tlist[key] += 1\n\t\telse \n\t\t\tlist[key] = 1\n\t\tend\n\tend\n\tlist\n\t#make it look pretty\nend", "def list_creation(items_string)\r\n\tshopping_list = {}\r\n\tintit_list = items_string.split(' ')\r\n\tintit_list.each do|item|\r\n\t\tshopping_list[item] = 1\r\n\tend\r\n\tshopping_list\r\nend", "def new_list(items)\n grocery_list = Hash.new(0)\n items.split(\" \").each do |x|\n grocery_list[x] += 1\n end\n grocery_list \nend", "def create_list(list)\n quantity = 1\n items = list.split(' ')\n grocery_list = { }\n\n items.each do |item|\n grocery_list[item] = quantity\n end\n grocery_list\nend", "def create_list(items)\n\n# Make an empty hash for grocery_list:\np grocery_list = {} \n\n \n# Takes the string of items that user puts in the create_list method, and turns it into an array:\np items = items.split\n\n# Iterate through each item in the array. This step turns the array into a hash buy asking if it has an item from the array as a key. If the item appears more than once in the array, it will count it as one key and give it a value of +1.\n items.each do | item |\n if grocery_list.has_key?(item)\n grocery_list[item] += 1\n else\n grocery_list[item] = 1\n end \n\n end\n grocery_list \nend", "def create_list(string)\n puts \"What is the default item quantity?\"\n default_quantity = gets.chomp.to_s\n list_array = string.split(' ')\n list_hash = {}\n list_array.each do |item|\n list_hash[item] = default_quantity\n end\n\n print_list(list_hash)\n\n list_hash\nend", "def create_list(string_of_items)\n hash_of_items = {}\n array_of_items = string_of_items.split(\" \")\n \n array_of_items.each do |item|\n hash_of_items[item] = 1\n end\n hash_of_items\nend", "def create_list(items)\r\n\tgrocery_list = {}\r\n\tlist_of_items = items.split(' ')\r\n\r\n\tlist_of_items.each { |item| grocery_list[item] = 1}\r\n\tgrocery_list.each {|item, quantity| puts item, quantity}\r\nend", "def create_list_of(string_of_items)\n\tary_of_items = string_of_items.split(' ')\n\titem_list = {}\n\tary_of_items.each {|x| item_list[x] = 1}\n\tprint_list(item_list)\nend", "def create_list(str, default_quantity=1)\n list = {}\n item_array = str.split\n item_array.each do |item|\n list[item] = default_quantity\n end\n print_list(list)\n return list\nend", "def create_list(string)\n grocery_list = {}\n array = string.split(\" \")\n array.each do |item|\n grocery_list[item] = 1\n end\np grocery_list\nend", "def list (strings)\n array_list = strings.split(/ /)\n grocery_list = Hash.new(0)\n array_list.each do |x|\n grocery_list[x] += 1\n end\n print_list(grocery_list)\n return grocery_list\nend", "def list (strings)\n array_list = strings.split(/ /)\n grocery_list = Hash.new(0)\n array_list.each do |x|\n grocery_list[x] += 1\n end\n print_list(grocery_list)\n return grocery_list\nend", "def create_list(grocery_string)\n grocery_list = {}\n items = grocery_string.split\n items.each do |item|\n grocery_list[item] = 1\n end\n print(grocery_list)\nend", "def create_list(string)\n grocery_list = {}\n array = string.split\n array.each do | item |\n grocery_list[\"#{item}\"] = 0\n end\n grocery_list\nend", "def create_list(string_of_items)\n string_ary = string_of_items.split(\" \")\n string_hash = {}\n string_ary.each { |item| string_hash[item] = 1 }\n print_grocery_list(string_hash)\n return string_hash\nend", "def create_list(string)\n grocery_list = {}\n array = string.split\n\n array.each do | item |\n grocery_list[\"#{item}\"] = 0\n end\n grocery_list\nend", "def create_list(input_string)\n input_arr = input_string.split(\" \")\n new_shopping_list = Hash.new\n new_shopping_list = Hash[input_arr.collect{|item, | [item, 1]}]\nend", "def create_list(items, quantity=1)\r\n item_array = items.split(' ')\r\n item_hash = {}\r\n item_array.each do |items|\r\n item_hash[items] = quantity\r\n end \r\n p item_hash # p will both print and return # puts will print but will not return. It will return nil.\r\nend", "def create_list(items_str)\r\n items_hash={}\r\n items_array=items_str.split(\" \")\r\n items_array.each do |it|\r\n items_hash[it]=1\r\n end\r\n print_list(items_hash)\r\nend", "def create_list(string)\n list = {}\n string = string.split \n\n string.each { |item| \n list[item] = 1\n }\n\n printhash(list)\n\n list\nend", "def create_list(input)\n items = {}\n input.split(' ').each do |item|\n items[item] = 0\n end\n print_list(items)\nend", "def create_grocery_list(str)\n items = str.split(\" \")\n grocery_list = Hash.new\n # Alternative way to store items in a list\n # counter = 0\n # while counter < items.length\n # \tgrocery_list.store(items[counter], 1)\n # \tcounter += 1\n # end\n items.each do |item|\n \tgrocery_list.store(item, 1)\n end\n p grocery_list\nend", "def shopping_list(user_input)\r\n grocery_list = {}\r\n list = user_input.split(\" \")\r\n list.each do |item|\r\n grocery_list[item] = 1\r\n end\r\n p grocery_list\r\nend", "def create_list(list_str)\nfinal_list = {}\narr = list_str.split(\" \")\n arr.each do |key|\n final_list[key] = 1\n# One refers to the default quantity. \n end \n final_list\nend", "def create_list(items)\n items_list = Hash.new(0)\n items_array = items.split(\" \")\n items_array.each do |x|\n items_list[x] += 1\n end\n return items_list\nend", "def create_list(item, quantity = 1)\n\tlist = {}\n\tsplit_item = item.split(\" \")\n\tsplit_item.each do |item_name|\n\t\tlist[item_name] = quantity\n\tend\n\treturn list\nend", "def make_list(items)\n grocery_bag = {}\n items_array = items.split(' ')\n items_array.each do |item|\n grocery_bag[item] = 1\n end\n p grocery_bag\nend", "def grocerylist(items)\n itemhash = {}\n items.split(\" \").each do |items|\n itemhash[items] = 0\n end\n # p itemhash\n return itemhash\nend", "def create_list(list)\n grocery_list = Hash.new\n default_quantity = 1 \n list.split(\" \").each {|x| grocery_list[x] = default_quantity }\n p grocery_list\nend", "def create_list(str)\n list = {}\n qty_default = 1\n arr = str.split(\" \")\n arr.each {|item| list[item] = qty_default}\n return list\nend", "def shopping_list(items)\n\t# separate the items into an array\n\titems = items.split\n\tputs \"Here are the items you entered.\"\n\tputs items\t\n\t# create the list to add items into.\n\t$list = Hash.new\n\t# enter quantity of each item.\n\titems.each_index do |x|\n\t\tputs \"Enter quantity with no spaces for #{items[x]}.\"\n\t\tquantity = gets.chomp\n\t\t# assign each quantity to the item and add to list\n\t\t$list[:\"#{items[x]}\"] = quantity\n\tend\n\tputs \"Here is your shopping list.\"\n\tputs $list\nend", "def create_list(string)\r\n array=string.split(\" \")\r\n list={}\r\n x=0\r\n array.each do |item|\r\n list[item]=x\r\n x+=1\r\n end\r\n list\r\nend", "def create_list(grocery_items)\n grocery_list = Hash.new(0)\n grocery_items.split.each { |item| grocery_list[item] += 1 }\n grocery_list\nend", "def create_list(grocery_string)\r\n\tgrocery_list = {}\r\n\titems = grocery_string.split\r\n\titems.each do |item|\r\n\t\tgrocery_list[item] = 1\r\n\tend\r\n\tprint(grocery_list)\r\nend", "def groceries(input)\n new_input = input.split(' ')\n list = Hash.new(1)\n new_input.each do |item|\n list[item] = 1\n end\n list\nend", "def create_list(list)\n groceries_list = {}\n list_array = list.split(\",\") # [carrots , 2, beans, 3]\n list_array.each_index do |index|\n if index.even?\n item = list_array[index].strip.to_sym \n quantity = list_array[index + 1].to_i\n groceries_list[item] = quantity\n end\n # break if list_array.length == index + 1\n end\n return groceries_list\nend", "def string_to_hash(hash, grocery)#accept input as a string\n\tgroceryarr = grocery.split(' ')\n\tgroceryarr.each do |grocery| #split item an add them to our hash\n\t\tadd_item(hash,grocery, 1)\n\tend\nend", "def create_list(items)\n grocery_list = {}\n item_array = items.split(\" \")\n item_array.each do |item|\n grocery_list[item] = 1\n end\n print_list(grocery_list)\n grocery_list\nend", "def create_list(item_string)\r\n items = item_string.split\r\n grocery_list = {}\r\n items.each do |item|\r\n grocery_list[item] = 1\r\n end\r\n grocery_list\r\nend", "def groceries(string)\n list = {}\n string.split(\" \").each do |item|\n list[item] = 1\n end\n format_list(list)\n list\nend", "def create_list(string)\r\n\tgrocery_hash = {}\r\n\tthe_list = string.split\r\n\tthe_list.each do |item|\r\n\t\tgrocery_hash[item] = 1\r\n\tend\r\n\tprint_list(grocery_hash)\r\nend", "def new_list(items)\r\n list = {}\r\n split_items = items.split(' ')\r\n split_items.each { |item|\r\n list[item] = 1\r\n }\r\n print_list(list)\r\n list\r\nend", "def grocery_list(items)\n new_grocery_list = {} \n each_item = items.split(\" \")\n each_item.each do |item|\n new_grocery_list[item] = 1\n end\n new_grocery_list \nend", "def create_list(string_of_items, default_quantity)\n grocery_array = string_of_items.split(' ')\n grocery_hash = {}\n grocery_array.each { |item| grocery_hash[item] = default_quantity }\n grocery_hash\nend", "def make_list(list, string_of_items)\n string_of_items.split(\" \").each do |item|\n list[item].nil? ? list[item] = 1 : list[item] += 1\n end\n list\nend", "def grocery_itemizer(grocery_string)\n\n\tgroceries = {}\n\n\titemized_array = grocery_string.split\n\n\titemized_array.each do |food|\n\t\tgroceries[food] = 1\n\tend \n\n\treturn groceries\n\nend", "def create_list(food_string)\n grocery_list = {}\n new_food_array = food_string.split(\" \")\n new_food_array.each do |food|\n grocery_list[food] = 0\n end\n # p grocery_list\n print_list(grocery_list)\n return grocery_list\nend", "def create_list(item)\n list = {}\n new_item = item.split(\" \")\n \n new_item.each do |food|\n list[food] = 0\n end\n return list\nend", "def create_list(string)\n\tgrocery_hash = {}\n\tthe_list = string.split\n\tthe_list.each do |item|\n\t\tgrocery_hash[item] = 1\n\tend\n\tprint_list(grocery_hash)\nend", "def create_list(items_string)\n list = {}\n items_array = items_string.split(\",\")\n\n items_array.each do |item|\n list[item] = 1\n end\n print_pretty_list(list)\nend", "def new_list (string)\nitem_hash= hash.new\nitem_array = string.split\nitem_array.each do |item|\n item_hash[item] = 1\nend\nitem_hash\nend", "def create_list(input_string)\n grocery_list = {}\n items = input_string.split(' ')\n items.each do |item|\n add_item_to_list(grocery_list, item, 1)\n end\n\n print_list(grocery_list)\n\n add_item_to_list(grocery_list, \"milk\", 1)\n update_item_from_list(grocery_list, \"Lemonade\", 2)\n update_item_from_list(grocery_list, \"Tomatoes\", 3)\n update_item_from_list(grocery_list, \"Onions\", 10)\n update_item_from_list(grocery_list, \"iceCream\", 20)\n\n print_list(grocery_list)\n\n remove_item_from_list(grocery_list, \"IceCream\")\n\n print_list(grocery_list)\n\nend", "def print_list(my_list)\r\n# input: \r\n \r\n# steps:\r\n# print to screen: iterate through hash item - quantity\r\n puts '------'\r\n puts \"Grocery list:\"\r\n my_list.each do |item, qty|\r\n puts \"#{item} - #{qty}\"\r\n end\r\n puts '-------'\r\n# output: each k,v pair printed surrounded by dashes\r\nend", "def generate_list(string_of_items)\n grocery_list={}\n default_value=1\n items=string_of_items.split(' ')\n items.each do |item|\n #Transfer items into hash\n grocery_list[item]=default_value\n end\n return grocery_list\n print(grocery_list)\nend", "def list_maker(items, *quantities)\r\n list_hash = {}\r\n list_array = items.split(' ')\r\n for i in 0..(list_array.length - 1)\r\n list_hash[list_array[i]] = quantities[i]\r\n end\r\n list_hash.map do |item, quantity|\r\n if quantity == nil \r\n list_hash[item] = 1 \r\n end\r\n end\r\n list_hash\r\nend", "def grocery_list(items)\n #method for create list\n array = items.split(\" \")\n #separate by spaces TEST\n #p grocery_array\n #test print\n hash = {}\n #empty hash\n array.each {|item| hash[item] = 1}\n #ends hash\n hash\n #test hash\nend", "def create_list(items)\n\titem_list = {}\n\titem_array = items.split(\" \")\n\tdefault_quantity = 1\n\titem_array.each do |item|\n\t\titem_list[item] = default_quantity\n\tend\n\tpretty_list(item_list) \nend", "def create_grocery_list(items)\n split_items = items.split(' ')\n list = {}\n split_items.each {|item| list[item] = 1}\n list\nend", "def create_list(string)\n\ttemp = string.split()\n\tgrocery_list = {}\n\ttemp.each do |item|\n\t\tgrocery_list[item] = 1\n\tend\n\t\n\tp grocery_list\nend", "def shopping_list(i)\n x = 1\n s = []\n i = i.split(\" \").uniq.sort\n i.each do |l|\n s << Hash[x, l]\n x += 1\n end\n print s\nend", "def create_grocery_list(string) \n grocery_list = Hash.new\n list = string.split(\" \")\n \n list.each do |food|\n grocery_list[food] = 0\n end\n \n grocery_list\nend", "def create_list(items)\n list = {}\n item_array = items.split(\" \")\n item_array.each do |item|\n list[item] = 1\n end\n print_list(list)\nend", "def create_list(items)\n items = items.split(' ')\n grocery_list = {}\n items.each do |item|\n grocery_list[item] = 1\n end\n p grocery_list\n grocery_list\nend", "def create_list(list_str)\n food_list = {}\n list_array=list_str.split(\" \")\n default_qty = 1\n list_array.each do |food|\n food_list[food.to_sym] = default_qty\n end\n food_list\nend", "def create_list(items)\n item_list = items.split(' ')\n grocery_list = {} \n item_list.each do |item|\n grocery_list[item] = 1\n end\n grocery_list \nend", "def create_list(items = '')\n list = {}\n items.split(' ').each {|item| list[item.to_sym] = 1}\n print_list(list)\n list\nend", "def new_grocery_list(items)\n list = {}\n array_of_items = items.split(\" \")\n array_of_items.each do |item|\n list[item] = 1\nend\nlist \nend", "def make_list(item_list)\r\n item_list = item_list.split(' ')\r\n list = {}\r\n item_list.each do | item |\r\n list[item] = 1\r\n end\r\n print_list(list)\r\n list\r\nend", "def create_list(items)\r\n list_array = items.split(\" \")\r\n list_hash = {}\r\n list_array.each do |i| \r\n if list_hash[i]\r\n list_hash[i] += 1\r\n else\r\n list_hash[i] = 1\r\n end\r\n end\r\n p list_hash\r\n list_hash\r\nend", "def create_hash(items, default_qty = 0)\n groceries = {}\n items.split.each { |food| groceries[food] = default_qty }\n groceries \nend", "def create_list(string)\n\t groceries = string.split(\" \")\n\t list_items = Hash.new\n\t groceries.each do |items|\n\t \tlist_items[items] = 1\n\t end\n list_items\nend", "def new_list(str)\n grocery_list = {}\n str.split(\" \").each {|item| grocery_list[item] = 1}\n pretty_list(grocery_list)\nend" ]
[ "0.7393834", "0.71228564", "0.7065592", "0.7029482", "0.7026936", "0.7024648", "0.7020407", "0.6938105", "0.69128233", "0.6728702", "0.6728076", "0.6670857", "0.66625106", "0.6618079", "0.66167235", "0.65895796", "0.65760183", "0.65728253", "0.65671855", "0.6554636", "0.654462", "0.65370923", "0.6532485", "0.65282226", "0.6527435", "0.65211576", "0.6518517", "0.65183747", "0.6506451", "0.6501924", "0.64853007", "0.6473183", "0.6462598", "0.6459327", "0.64504874", "0.64406323", "0.6440276", "0.6416203", "0.6416203", "0.64047927", "0.6401288", "0.6399799", "0.6392139", "0.63909274", "0.6390892", "0.638061", "0.63396543", "0.6338453", "0.633692", "0.6335605", "0.6331908", "0.6330794", "0.6326616", "0.6322509", "0.63181716", "0.63141614", "0.6306044", "0.6302181", "0.6292057", "0.6285876", "0.6284755", "0.6279395", "0.62670285", "0.6264979", "0.62554055", "0.6249469", "0.6247497", "0.6235927", "0.6233188", "0.62262344", "0.6225827", "0.62207144", "0.62131786", "0.62080544", "0.62065923", "0.620485", "0.6202964", "0.6200065", "0.6190612", "0.61864185", "0.6183595", "0.61825013", "0.6166438", "0.6162666", "0.6162125", "0.6157468", "0.61474013", "0.6136191", "0.61316645", "0.6120893", "0.61137235", "0.6113547", "0.6106975", "0.6105731", "0.60899895", "0.6085146", "0.6084559", "0.6083601", "0.6073054" ]
0.61277467
90
Method to add an item to a list input: item name and optional quantity steps: Take 1 argument, and 1 optional argument. Increment our hash using the first argument as the key, and the second argument (if given) with 1. If no second arg, use the default as 1. Return updated list_hash. output:
def add_item(list_hash, food, quantity = 1) list_hash[food] += quantity return list_hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_item(list_name, item, quantity=1)\r\n# input: list, item name, and optional quantity\r\n# steps: add item and its quantity to the hash\r\n list_name.store(item, quantity)\r\n# output: hash with new item\r\n p list_name\r\nend", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def additem(list, item, number = 1)\n# input: hash, item name and optional quantity\n# steps: push an item into the hash\n list.store(item, number)\nend", "def add_item(hash_list, new_item, quantity = 1)\n hash_list[new_item] = quantity\n p hash_list\nend", "def add_item(existing_list, new_item, item_integer)\n\t# input: item name and optional quantity\n\t# steps: pass in item name as key and assign value\n\texisting_list[new_item] = item_integer\n\t# output: hash\n\tp existing_list\nend", "def add_item(item, quantity, list)\n\t# steps: \n\t# if the item is already in the list\n\tif list[item.to_sym] \n\t\t# add to the quantity\n\t\t#list[item.to_sym] = list[item.to_sym] + quantity\n\t\tlist[item.to_sym] += quantity\n\t# otherwise\n\telse\n\t\t# make a new key with the input quantity\n\t\tlist[item.to_sym] = quantity\n\tend\n\t# output:\n\t\t# updated list\n\tlist\nend", "def list_add(hash_items, item_name, quantity = 1)\n hash_items [item_name] = quantity\n return hash_items\nend", "def add_to_list(list_hash, item, qty)\r\n\tlist_hash[item] = qty\r\n\tlist_hash\t\r\nend", "def add_item_to_list(hash, item_to_add, qty)\n hash[item_to_add] = qty\nend", "def add_item(list, name, quantity = 1) \r\n# input: item name and optional quantity\r\n# steps: \r\n# create add method with name and optional quantity arguments\r\n# add name and quantity to hash\r\n list[name] = quantity\r\n# output: print \"your item has been added to the hash\"\r\n return list\r\nend", "def add_item(my_list, item, quantity)\r\n #input: a string seperated by an integer \r\n #steps: use a method that adds an item and quantity to the hash.\r\n my_list.store(item, quantity)\r\n # use a hash or store method hash.merge!(key => value) \r\n #output = hash with the updated item/quantity. \r\n my_list\r\n \r\nend", "def add_item(list, new_item, opt_quant)\n list_hash = list\n if opt_quant == nil || opt_quant == 0\n opt_quant = 2\n end\n list_hash[new_item] = opt_quant\n return list_hash\nend", "def add_item(item_name, item_qty)\n# $list_items[item_name] = item_qty\n # my_hash[key] = value\n # This will create a NEW key value pair\n # OR update (aka replace) the value for an existing key.\n \n # my_hash[key] += value\n # will INCREASE the value for an existing key.\n if $list_items.include?(item_name)\n # Increase that item\n $list_items[item_name] += item_qty\n else\n # Create the new item\n $list_items[item_name] = item_qty\n end\nend", "def add_item_or_update_quantity(hash_of_list, item_name, item_quantity = 1)\n hash_of_list[item_name] = item_quantity\n hash_of_list\nend", "def add_item(list, item_name, quantity = 1)\n # steps:\n # check IF item is included in list\n # increment item by quantity\n # ELSE - set item as new key and assign it to quantity as value\n list.include?(item_name) ? list[item_name] += quantity : list[item_name] = quantity\n\n # output: return the updated hash\n list\nend", "def add_item_to_list(list_name,item_to_add,quantity_to_add = 1)\n#create a hash element with the item name and the quantity, if specified\n#if no quantity is specified, default value = 1\n new_item = { \n item_name: item_to_add,\n quantity: quantity_to_add\n }\n# insert the hash into array \n list_name.push(new_item)\n new_item\nend", "def add_item(list, item, quantity)\n\n\tlist[item] = quantity\n\tlist\n\nend", "def add_item(list, item, quantity=0)\n\tlist[item] = quantity\n\tlist\nend", "def add_item(hash_of_items, item, quantity=1)\n hash_of_items[item] = quantity\n hash_of_items\nend", "def add_item(item, quantity, list)\n\tlist[item] = quantity\n\titem\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n list\nend", "def add(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, optional_quantity)\n\nlist[item_name] = optional_quantity\n\n# input: list, item name, and optional quantity\n# steps:\n # Add new hash key based on item name\n # Tell method there may or may not be a argument passed in for quantity\n # assign quantity to 'optional-quantity' argument in method definition\n # Access method that contains initialized hash def add_item(create_list, item_name, quantity = 3)\n# output:\n # updated grocery list\nend", "def add_item(item, list, quantity=1)\n if !list.has_key?(item)\n list[item] = quantity\n return list\n else\n list[item] += quantity\n return list\n end\nend", "def add_new_items(list, item_name, quantity=1)\n list[item_name] = quantity\n list\nend", "def add_item(list, item, qty)\n list[item] = qty\n list\nend", "def add_item(list, item, quantity=0)\n list[item] = quantity\n list\nend", "def add_item(item, quantity=1, hash)\n# get item name and quantity\n# if there's no quantity, set it to 1\n\thash[item] = quantity\n\t# output: return the hash with updated key/value pairs\n\thash\nend", "def add (list, item, quantity)\n\tlist[item] = quantity\nend", "def add_item(list, item, quantity)\n list[item] = quantity\nend", "def add_item(list, item, quantity)\n list[item] = quantity\nend", "def add(list, item, quantity)\r\n\tlist[item] = quantity\r\n\tlist\r\nend", "def add_item(item, list, quantity)\n list[item] = quantity\nend", "def add_item (list, item, quantity = 1)\n\tlist[item] = quantity\n\treturn list\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n return list\nend", "def add_item(list, item_name, quantity=1)\n list[item_name] = quantity\nend", "def add_list(item_name, item_list, quantity = 1)\n item_list[item_name] = quantity\nend", "def add_item(list, item_to_be_added, qty = 1)\n # if !list.has_key? item_to_be_added\n # list[item_to_be_added] = qty\n # end\n list[item_to_be_added] = qty if !list.has_key? item_to_be_added\n list\nend", "def add_item(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "def add_item(list, item, quantity = 1)\n list[item] = quantity\n list\nend", "def add_items(list, item_name, quantity=0)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def add_item(list, item_name, qty=1)\n if list.has_key?(item_name)\n list[item_name] += qty\n else\n list[item_name] = qty\n end\n list\nend", "def add_item(item,quantity,list)\n\tlist[item] = quantity\nend", "def add_item_to_list(string, quantity, hash)\n\thash[string.to_sym] = (hash[string.to_sym] || 0) + quantity\n\tp hash\nend", "def add_to_list(list, item, quantity = 1)\n\tlist[item] = quantity\nend", "def add_item(list, item, qty = 1)\n list[item] = qty\n\n list\nend", "def add_item(list, item, quantity=1)\n list[item] = quantity\nend", "def add_item!(list, item, qty=1)\r\n list[item] = qty\r\n list\r\nend", "def add_item(list, item_name, quantity)\n list[item_name.to_sym] = quantity\n list \nend", "def add_item(list_name, item_name, quantity = 1)\r\n if list_name.has_key?(item_name)\r\n list_name[item_name] += quantity\r\n else\r\n list_name[item_name] = quantity\r\n end\r\nend", "def add_item(list, key, quantity)\n list[\"#{key}\"] = quantity\n list\nend", "def add_item(list, new_item, qty=1)\n list[new_item] = qty\nend", "def add_item(list,item_name, qty)\n list[item_name] = qty\nend", "def add_item(new_list, item_name, quantity=1)\r\n \r\n new_list[item_name] = quantity\r\n \r\nend", "def add_item(list, item, quantity = 1)\r\n# input: list, item name, and optional quantity\r\n# steps: \r\n # check for optional quantity. if not present, set to default (1)\r\n list[item] = quantity\r\n # update list with input\r\n puts \"#{item.upcase} has been added to your grocery list!\"\r\n p list\r\n# output: complete list, updated\r\nend", "def add(input_list, item, quantity)\n input_list[item] = quantity\nend", "def add(list, item, quantity)\r\n list[item] = quantity\r\n list\r\n\r\nend", "def add_item(list, new_item, quantity=1)\n list[new_item] = quantity \nend", "def add_item(list, item_name, quantity = 1)\r\n list[item_name] = quantity\r\nend", "def add_item(list, item, quantity)\n #list = item.push\n list[item] = quantity.to_i\n list\nend", "def add_item(list, item_name_string, quantity=1)\r\n\titem_key = item_name_string.to_sym\r\n\tlist[item_key] = quantity\r\n\treturn list\r\nend", "def add_item(hash, item, quantity)\n\t hash[item] = quantity\n\t return hash\nend", "def add_item(list, item, qty = 1)\n list[item] = qty\n return list\nend", "def add_to_grocery_list(grocery_list, item_name, quantity=1)\n # steps: add item to hash and set quantity\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def list_add(list, item_name, quantity=1)\n list[item_name] = quantity\n p list\nend", "def add_item(list, item, quantity)\n if list.has_key?(item)\n list[item] = list[item] + quantity\n else\n list[item] = quantity\n end\n return list\nend", "def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend", "def add_item(input_hash, item, qty = 0)\n# steps: use input item as key and input quantity as value \n input_hash[item] = qty\n# output: hash data structure of key/value pairs\n return input_hash\nend", "def add_item(list, item, quantity=1)\r\n# input: item name and optional quantity\r\n# steps: \r\n # Use shopping list as input\r\n # Use the item to be added as 2nd input\r\n # Use the item quantity as a 3rd input (look up whether optional input is possible)\r\n # Add the item and quantity to the shopping list\r\n list[item] = quantity\r\n# output: shopping list with the added item and quantity\r\n printlist(list)\r\nend", "def add_item(list, item, quantity=1)\n list[item] = quantity\n p list\nend", "def add_item(list, item, quantity)\n list[item] = quantity\n p list\nend", "def add_item(list, item, qty=1)\n list[item] = qty\n p \"#{item} : #{list[item]}\"\nend", "def add_item(list,item,quantity=1)\r\n list[item] = quantity\r\n list\r\nend", "def add_item(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def add_item(list, item, qty=1)\n if !list.has_key?(item)\n list[item] = qty\n end\n\n return list.each {|k,v| puts \"#{k}: #{v}\"}\nend", "def update_quantity(list_name, item, value)\r\n# input: list, item name, new quantity\r\n# steps: find item in the hash and change quantity to new quantity\r\n list_name[item] = value\r\n# output: updated hash with new value for item key\r\n p list_name\r\nend", "def add_item(list,item,quantity=1)\n list[item] = quantity\nend", "def add_item(list,item,quantity=1)\n list[item] = quantity\nend", "def add_item(list, item, qty)\n list[item] = qty\n p list\nend", "def add_item(list, item, quantity = 1)\r\n list[item] = quantity\r\nend", "def add(item, quantity, hash)\n hash[item] = quantity\nend", "def add_item (list, item, qty)\n list[item]=qty\nend", "def add_item(current_list, item_added, quantity)\n current_list[item_added] = quantity\n current_list\nend", "def add_item(list, item_name, quantity = 1)\n if list.include?(item_name)\n list[item_name] += quantity\n else\n list[item_name] = quantity\n end\n list\nend", "def add_item(list, item, quantity=1)\r\n\tlist[item] = quantity\r\n#\tp list\r\nend", "def add_item(hash, new_item, qty)\n hash[new_item] = qty\n hash \nend", "def add_item(list, item, quant)\n list[item] = quant\nend", "def add_item(grocery,item_name,quantity)\n # input: list, item name, and optional quantity\n # steps: insert item_name as a key and quantity as a value to the hash \n grocery[item_name] = quantity\n # output:display the latest list\n display_list(grocery)\nend", "def list_add(list, item_name, quantity=1)\r\n list[item_name] = quantity\r\n p list\r\nend", "def add_item(list, item, quant)\n list[item] = quant\nend", "def add_to_list(list, item, quantity)\n #method to add items\n list[item] = quantity\nend", "def add_item(name, quantity, list)\n list[name] = quantity\n p list\n return list\nend", "def add_list(list,new_item,quantity=1)\n list[new_item] = quantity\n list\nend", "def add_to_list(list, item, quantity = 1)\n list[item] = quantity\n p list\nend" ]
[ "0.8476646", "0.8380483", "0.82813907", "0.81637627", "0.8160089", "0.8112604", "0.8033509", "0.80103284", "0.7957742", "0.7940187", "0.7877532", "0.7858696", "0.78544647", "0.7846281", "0.7844471", "0.7841629", "0.78342634", "0.7822519", "0.7812931", "0.78082985", "0.7777492", "0.7777492", "0.7767434", "0.7766755", "0.7766755", "0.7764344", "0.7754963", "0.7748347", "0.77379715", "0.773738", "0.77347964", "0.77241814", "0.77095616", "0.7702098", "0.7689001", "0.7689001", "0.76844335", "0.7679825", "0.7668492", "0.7663998", "0.76540685", "0.76512593", "0.76458055", "0.76423234", "0.7640075", "0.7637484", "0.76277226", "0.76268005", "0.76239824", "0.7606955", "0.76014143", "0.7599768", "0.75989515", "0.75985223", "0.75946605", "0.75942147", "0.7594051", "0.7589547", "0.75846845", "0.75813556", "0.7577745", "0.75543875", "0.7554381", "0.75532913", "0.7546759", "0.75460595", "0.7537285", "0.7527095", "0.75229675", "0.75204456", "0.75184375", "0.7516755", "0.7508931", "0.75049675", "0.7496264", "0.74949723", "0.7493522", "0.74915713", "0.74900234", "0.7481504", "0.74804926", "0.7472541", "0.7472541", "0.74654263", "0.74601436", "0.7456291", "0.74520975", "0.7447096", "0.7443179", "0.74397933", "0.74325496", "0.7422685", "0.74030054", "0.7384413", "0.73814297", "0.73699254", "0.73552185", "0.7354623", "0.73501885" ]
0.75773835
62
Method to remove an item from the list input: Look at the list and remove a specified item. steps: Do the opposite of add_item()! output: Show the updated list without that item.
def remove_item(updated_hash, food) updated_hash.delete(food) return updated_hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_item(item, list)\n\t# steps: delete the item if it exists\n\tlist.delete_if {|list_item| list_item == item.to_sym}\n\t# output: updated list\n\tlist\nend", "def remove_item(list, item)\n\tlist.delete(item)\n\tlist\nend", "def remove_item(list, item_removed)\n list.delete(item_removed)\nend", "def remove_item(list, item)\r\n# input: shopping list and item to be removed\r\n# steps: \r\n # Use shopping list as input\r\n # Use item to be removed as input\r\n # Remove the item from the list if it exists on the list\r\n list.delete(item)\r\n# output: shopping list with item removed\r\n printlist(list)\r\nend", "def remove_item(new_list, item)\n \n new_list.delete(item)\n \n new_list\nend", "def remove_item(list, item)\r\n# input: item to be removed, list\r\n# steps: \r\n # check if item exists\r\n # remove item\r\n list.delete(item)\r\n # print success message of item removed\r\n puts \"#{item.upcase} has been removed to your grocery list!\"\r\n p list\r\n# output: updated list\r\nend", "def remove_item(item)\n index = @list.index(item)\n remove_item_at(index)\n end", "def remove_item(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item (list, item)\n list.delete(item)\nend", "def remove_item(list,item)\n\tlist.delete(item)\n\tp list\nend", "def remove_item (item, list)\n list.delete(item)\n return list\nend", "def remove(input_list, item)\n input_list.delete(item)\nend", "def remove_item(list, removeitem)\n\t# input: existing list, item name\n\t# output: updated list\n\n\tmatch_index = find_item(list, removeitem)\n\t# alert if not found\n\tif not match_index\n\t\tmsg = \"\\n\\n** WARNING remove_item failure: item \\\"#{removeitem}\\\" \"\n\t\tmsg += \"not found in list. List unchanged **\"\n\t\treturn list\n\telse\t\t\t\n\t\tlist.delete_at(match_index)\n\t\tputs \"\\n\\nList updated: item '#{removeitem}' removed from list.\\n\"\n\t\tprint_list(list) if print\n\t\treturn list\n\tend\n\t# return updated list\n\t\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list,item)\r\n\r\n list.delete(item)\r\n list\r\nend", "def remove_item(list, item_remove)\n list.delete(item_remove)\nend", "def remove_item(item_list, item)\r\n item_list.delete(item)\r\n item_list\r\nend", "def remove_item (list, item)\n list.delete(item)\nend", "def remove_item(item, list)\n list.delete(item)\n return list\nend", "def remove_item(list, item)\r\n\tlist.delete(item)\r\n\treturn list\r\nend", "def remove_item(item, list)\n list.delete(item)\nend", "def remove_item(list, item)\n\tlist.delete(item)\nend", "def remove_item(list,item)\n\tlist.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\n list\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item)\n list.delete(item)\n return list\nend", "def remove(list, item)\n\tlist.delete(item)\n\tlist\nend", "def remove_item(item)\n # raises WrongListException if item.list != self\n # TODO\n end", "def remove_item_from_list(list,item)\r\n list.delete(item)\r\n print_list(list)\r\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item(list, item)\n list.delete(item)\nend", "def remove_item!(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def remove_item(list, item)\n list.delete(item)\n p list\nend", "def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend", "def remove_item(new_list, item_name)\r\n new_list.delete(item_name)\r\nend", "def remove_item(list, item_name)\r\n list.delete(item_name)\r\n list\r\nend", "def remove_item (item,list)\nlist.delete(item)\nlist\nend", "def remove_item(list, item_name)\n list.delete(item_name)\n list\nend", "def remove (list, item)\n\tlist.delete(item)\nend", "def remove_an_item(list, item)\n #method to remove item\n list.delete(item)\nend", "def remove_item(list,item)\n list.delete(item)\n p list\nend", "def list_remover(list,item) #takes 2 arguments, 1 list and name of an item\n\tlist.delete(item)\t\n\t\nend", "def remove_from_list(list, item)\n\tlist.delete(item)\nend", "def remove_item(item, list)\n\tlist.delete_if do |i|\n\t\ti == item \n\tend\nend", "def remove_item(olist, item)\n olist.delete(item) \n olist\nend", "def remove_item(item, list)\r\n list.delete(item)\r\n p list\r\n list\r\nend", "def remove_item(list, item)\r\n list.delete(item)\r\n p list\r\nend", "def remove(list, item)\r\n# input: ask what item user wants to remove\r\nif list.include?(item)\r\n\tlist.delete(item)\r\nend \r\np list\r\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tp list\nend", "def remove_item(list, item_name)\n list.delete(item_name)\nend", "def remove(list,item)\r\n\tlist.delete(item)\r\n\tlist\r\nend", "def remove(list, item)\r\n list.delete(item)\r\n list\r\nend", "def remove(list, item)\n\tlist.delete(item)\nend", "def remove_item(list_items, item_name)\n list_items.delete(item_name)\nend", "def remove_from_list(item,list)\n list.delete(item)\nend", "def remove_item(shopping_list, item)\r\n\r\n\tshopping_list.delete(item)\r\n\r\nend", "def remove_from_list(list, item)\n list.delete(item)\n p list\nend", "def remove_item(my_list, item)\r\n# input: an item (something already in the list)\r\n# steps:\r\n my_list.delete(item)\r\n \r\n my_list\r\n# declare hash\r\n# delete method for item\r\n# output: hash with removed item\r\nend", "def remove_from_list\n empty_list if @mylist.length <= 0\n item_names = @mylist.map { |item| item['name'] }\n item_names << 'Back'\n selection = @prompt.select('Which item would you like to remove?'.colorize(:light_green), item_names)\n @menu.my_list if selection == 'Back'\n @mylist.each_with_index do |item, index|\n @mylist.delete_at(index) if item['name'] == selection\n end\n update_file\n end", "def remove(list, food_item)\n\tlist.delete(food_item)\n\tlist\nend", "def remove_item(list, rm_item)\n# steps:\n # use delete method with key (item) as argument\n list.delete(rm_item)\n # return list\n list\nend", "def remove(final_list, item)\r\n final_list.delete(item)\r\n end", "def del_item(list, item_to_del)\n list.delete(item_to_del)\nend", "def remove_item(groceries_list, item_to_remove)\n\t# remove item from list\n\tgroceries_list.delete(item_to_remove)\n\t# return updated list\n\tgroceries_list\nend", "def rem_list(item_name, item_list)\n item_list.delete(item_name)\n puts \"You just removed #{item_name} from the list.\"\nend", "def remove_item\n\n end", "def remove_item(list, item_to_be_removed)\n # if list.has_key? item_to_be_removed\n # list.delete(item_to_be_removed)\n # end\n list.delete(item_to_be_removed) if list.has_key? item_to_be_removed\n list\nend", "def remove_item(list, item_name)\n # steps:\n # check IF item is included in list\n # delete the item\n # ELSE, print a message to the user\n list.include?(item_name) ? list.delete(item_name) : puts(\"No #{item_name} on the list.\")\n \n # output: return updated hash or the original hash\n list\nend", "def delete_item(list_item)\n @list.delete(list_item)\n @list\n end", "def remove_item(list, item_to_remove)\n list.reject! { |item, quantity| item == item_to_remove }\n return list\nend", "def remove_item(list_item,user_list)\n user_list.delete(list_item)\n user_list\nend", "def remove(list, item_name)\r\n\tlist.delete(item_name)\r\n\tp list\r\nend", "def remove_item(shopping_list, item)\n shopping_list.delete(item)\nend", "def remove_item(grocery_list, item)\r\n\tgrocery_list.delete(item)\r\n\tgrocery_list\r\nend", "def remove_item(list, item_name)\r\n\tif list.has_key?(item_name)\r\n\t\tlist.delete(item_name)\r\n\tend\r\n\tlist\r\nend", "def remove(list, item_name)\n\tlist.delete(item_name)\nend", "def remove_item(list, food)\n list.delete(food)\nend", "def delete_item(current_list, item)\n current_list.delete(item)\n current_list\nend", "def remove_item(list, item_name)\r\n # list.delete_if { |item, amount| item == item_name }\r\n list.delete(item_name)\r\nend", "def delete_item(list, item)\n\tlist.delete(item)\n\tlist\nend", "def remove_item(list, remove_item)\n if list.include?(remove_item)\n list.delete_if { |item| item == remove_item }\n list\n else\n puts \"There is not #{remove_item} in the list\"\n end\nend", "def remove_item(item)\n\t$grocery_list.delete(item)\n\tp \"You crossed off #{item} from your list.\"\nend", "def remove_item(list, item_name)\n if list.has_key?(item_name)\n list.delete(item_name)\n end\n list\nend", "def remove_item(name, list)\n list.delete(name)\n p list\n return list\nend", "def remove_item(list, item)\n if list.has_key?(item)\n list.delete(item)\n else\n puts \"ERROR: Item not in list\"\n end\n return list\nend", "def remove_item(list, list_item)\n if list.has_key?(list_item)\n list.delete(list_item)\n else\n puts \"Item is not in list\"\n end\n p list\n list\nend", "def remove_item(list, item_name)\n\tlist.delete_if { |item, quantity| item === item_name }\nend", "def delete_item(item)\n\t\t#takes in an item and returns a new list\n\t\t@list.delete(item)\n\t\treturn @list\n\tend", "def remove_item(list_name, item)\r\n# input: list, item name\r\n# steps: delete item name and value from hash\r\n list_name.delete(item)\r\n# output: updated hash with item removed\r\np list_name\r\nend" ]
[ "0.8309526", "0.81510586", "0.8123036", "0.811851", "0.8104933", "0.8064743", "0.80269223", "0.80100244", "0.80062795", "0.7990043", "0.79897976", "0.7964092", "0.7963934", "0.7963669", "0.7963669", "0.7963669", "0.7963669", "0.7961619", "0.79605746", "0.7958668", "0.7956096", "0.79534554", "0.79509", "0.79485047", "0.79370534", "0.79351944", "0.79265535", "0.7920518", "0.7913038", "0.7913038", "0.7908729", "0.7908729", "0.7908398", "0.7908398", "0.7908398", "0.78975606", "0.7896354", "0.7892868", "0.789049", "0.7884982", "0.7878814", "0.78671473", "0.7859396", "0.7859396", "0.78590876", "0.78576034", "0.7850288", "0.7847916", "0.78479016", "0.78375673", "0.7825213", "0.78188777", "0.7814219", "0.7804407", "0.779684", "0.77898276", "0.7776207", "0.77738065", "0.77705914", "0.7754246", "0.77532244", "0.77449185", "0.7742054", "0.77162814", "0.7704827", "0.7672871", "0.7662619", "0.7646146", "0.7646038", "0.7636971", "0.7635719", "0.7624316", "0.7610592", "0.76096904", "0.7598255", "0.7594492", "0.75915617", "0.75710547", "0.75670236", "0.755977", "0.7522399", "0.75208527", "0.75125307", "0.7496574", "0.74930626", "0.74923503", "0.7482522", "0.747684", "0.74730885", "0.7466971", "0.7464835", "0.74519485", "0.74459034", "0.7428463", "0.74262637", "0.7417852", "0.741236", "0.7383358", "0.73514926", "0.7348855", "0.7327707" ]
0.0
-1
Method to update the quantity of an item input: updated_and_removed (hash), the food, and also the integer/value update steps: Call for the key, pass in an argument for the value (to update) output: hash with quantities changed
def update_quantity(updated_and_removed, food, quantity) updated_and_removed[food] = quantity return updated_and_removed end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_item_quantity(hash_of_items, item, quantity)\n hash_of_items[item] = quantity\n hash_of_items\nend", "def update_quantity (item, quantity)\n item_hash[item] = quantity\nend", "def update_quantity(list, upd_item, new_quantity)\n# steps:\n # reassign key (item) a new value (quantity)\n list[upd_item] = new_quantity\n # return list\n list\nend", "def quantity_update(hash, grocery, quantity)#ask user for item key they wish to change\n\thash[grocery] = grocery #locating matching key\n\thash[grocery] = quantity #updating value of that key\nend", "def update_quantity(hash, item, quantity)\n hash[item] = quantity\nend", "def update_quantity(input_hash, item, qty)\n# steps: use input item as key and input quantity as value\n# output: hash \n input_hash[item] = qty\n \nreturn input_hash\nend", "def update_item_quantity(hash, item, quantity)\n hash[item] = quantity\n hash\nend", "def update_item(hash, item, qty)\n hash[ item ] = qty\nend", "def update(hash, item, qty)\n hash[item] = qty\nend", "def update(hash, item, qty)\n hash[item] = qty\nend", "def update_quantity(item, quantity, hash)\n hash[item] = quantity\n return hash\nend", "def update_quantity(hash, item, quantity)\n\thash[item] = quantity\n\treturn hash\nend", "def update_item(updated_item, updated_item_quantity, grocery_hash) \n grocery_hash[updated_item] = updated_item_quantity\n return grocery_hash\nend", "def update_qty(list_hash, item, qty)\r\n \tlist_hash[item] = qty\r\n \tlist_hash\r\nend", "def update_quantity(hash, item, quantity)\n hash[item] = quantity\n return hash\nend", "def update_amount(hash, item, new_quantity)\n\thash[item.to_sym] = new_quantity\n\thash\nend", "def update_quantity(hash, item, quantity)\n\n if hash.has_key?(item)\n hash[item] = quantity\n end\n return hash\n\nend", "def update_item_from_list(hash, item_to_update, new_qty)\n if hash.has_key?(item_to_update)\n hash[item_to_update] = new_qty\n else\n \"It looks like #{item_to_update} wasn't in the hash after all!\"\n end\nend", "def update_qty(list, item_to_update, new_qty)\n # if list.has_key? item_to_update\n # list[item_to_update] = new_qty\n # end\n list[item_to_update] = new_qty if list.has_key? item_to_update\n list\nend", "def update_item(grocery_hash, grocery, quantity)\n grocery_hash[grocery] = quantity\nend", "def update_quantity(list_name, item, value)\r\n# input: list, item name, new quantity\r\n# steps: find item in the hash and change quantity to new quantity\r\n list_name[item] = value\r\n# output: updated hash with new value for item key\r\n p list_name\r\nend", "def update_qty(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "def update_quantity(list, item, new)\n if list.has_key?(item)\n list[item] = new\n #This is a different way that merges a new hash to update old hash\n # new_list = {key => new_quantity}\n # list.merge!(new_list) {|key, old_quantity, new_quantity| new_quantity}\n # p list\n end\nend", "def update_quantity(grocery_list, item_to_update, qty)\n grocery_list[item_to_update] = qty\n grocery_list\nend", "def update_quantity(hash, item_name, quantity)\r\n hash[item_name] = quantity\r\n hash\r\nend", "def update_quantity(hash, item, quantity)\r\n\tnew_hash = {item => quantity}\r\n\thash.merge!(new_hash)\r\n\thash\r\nend", "def update_quant(list, item_key, quant_update)\n list_hash = list\n new_hash = {}\n new_hash[item_key] = quant_update\n list_hash.merge(new_hash) {|item_key, old_quant, quant_update| quant_update}\nend", "def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend", "def item_quantity(list, item_to_update, quantity)\n list[item_to_update] = quantity \nend", "def update_quantity(list, item, updated_quantity)\n list[item] = updated_quantity\n list\nend", "def update_qty(shopping_list, item, quantity)\r\n\r\n\tadd_item(shopping_list, item, quantity)\r\n\r\nend", "def update_quantity(item, grocery_hash={}, quantity)\n\tif grocery_hash.include?(item)\n\t\tgrocery_hash[item] = quantity\n\tend\n\treturn grocery_hash\nend", "def update(list, food_item, quantity)\n\tlist[food_item] = quantity\n\tlist\nend", "def update_quantity(list, item, qty)\n list[item] = qty\n list\nend", "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend", "def update_quantity_of_items(list, item, quantity)\n list[item] = quantity\nend", "def update_item_from_list(list, food, update_quantity)\n list[food] = update_quantity\n list\nend", "def update_quantity(list, item, quant)\n list[item] = quant\nend", "def update_quantity(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend", "def update_quantity(grocery, item, update_quantity)\n if grocery.has_key?(item)\n grocery[item] = update_quantity\n end\n grocery\nend", "def update_qty(list, item, qty)\n if list.has_key?(item)\n list[item] = qty\n end\n return list.each {|k,v| puts \"#{k}: #{v}\"}\nend", "def update_quantity(list, item, quantity)\n #method to update quantity\n #can also add items\n list[item] = quantity\nend", "def update_quantity(grocery,item_name,new_quantity)\n # input:list, item name, and new_quantity\n # steps: change old value of item_name with the new_quantity\n grocery[item_name] = new_quantity\n # output: display the latest list\n display_list(grocery)\nend", "def update_quantity(item, new_quantity, grocery_list)\n grocery_list[item] = new_quantity\nend", "def update_item(list, item, quantity)\r\n add_item(list, item, quantity)\r\n# input: Shopping list, item to be updated, new quantity\r\n# steps:\r\n # Use shopping list as input\r\n # Use item to be updated as input\r\n # Use new quantity to be updated as input\r\n # Update the quantity of the item on the list\r\n # list[item] = quantity\r\n# output: shopping list with updated quantity\r\n # printlist(list)\r\nend", "def update_quantity(groceries_list, item, new_quantity)\n\t# Change value for inputted key to the desired quantity\n\tgroceries_list [item] = new_quantity\n\tgroceries_list\nend", "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def update_quantity(list, item_name, qty)\n list[item_name] = qty\nend", "def update_quantity(list, item, quant)\n list[item] = quant\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "def update_qty(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "def update_quantity(list, item, new_quantity)\n list.each do |key, value|\n if key == item\n list[key] = new_quantity\n end\n end\nend", "def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend", "def update_item(list,item,quantity)\n list[item] = quantity\nend", "def update_item(list,item,quantity)\n list[item] = quantity\nend", "def update_quanity(list, item, quantity)\r\n# input: list, item and quantity to be updated to\r\n# steps:\r\n # check if item exists\r\n # update quantity\r\n list[item] = quantity\r\n # print success \"your cart has been updated!\"\r\n puts \"The quantity for #{item.upcase} has been updated in your grocery list!\"\r\n p list\r\n# output: updated list with new quantity\r\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity.to_i\n list\nend", "def update(item,quantity,list)\n\tlist[item] = quantity\nend", "def update_item(list, item_name, new_qty)\n if list.has_key?(item_name)\n list[item_name] = new_qty\n else\n list = add_method(list, item_name, new_qty)\n end\n list\nend", "def update_item_quantity(list_hash,item_name,quantity)\n if list_hash[item_name]\n puts \"Updated the quantity of #{item_name} to: #{quantity}.\"\n list_hash[item_name] = quantity\n else\n puts \"Item does not exist.\"\n end\n\n list_hash\nend", "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "def update(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def update_item(item, list, quantity)\n if list.has_key?(item)\n list[item] = quantity\n return list\n else\n return list\n end\nend", "def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend", "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "def update(item, quantity, list)\n\t# steps: if the item is in the list\n\tif list.include? item.to_sym\n\t\t# update the quantity\n\t\tlist[item.to_sym] = quantity\n\telse \n\t\tadd_item(item, quantity, list)\n\tend\n\t# output: return the updated list\n\tlist\nend", "def update (list, item, quantity)\n\tlist[item] = quantity\nend", "def update_item(list, name, change_in_quantity)\n normalize_string(name)\n if (list[name] + change_in_quantity <= 0)\n remove_item(list, name)\n else\n list[name] += change_in_quantity\n return list\n end\nend", "def update (list, item, qty)\n list[item] = qty\nend", "def update_quantity(list,item,item_count)\n\tlist[item] = item_count\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity.to_i \n grocery_list\nend", "def add_or_update_item_qty(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend", "def update_item (list,item,quantity)\n\tlist[item] = quantity\nend", "def update(list, item, qty)\n add_item(list, item, qty)\nend", "def update(list, item, quantity)\n\tlist[item] = quantity\nend", "def update_quantity_in_grocery_list(grocery_list, item_name, quantity)\n # steps: update quantity for item\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend", "def update(groceries_list, update_item, update_quantity)\n\tgroceries_list[update_item.to_sym] = update_quantity\nend", "def update_item(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list \nend", "def update(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "def update_quant(current_list, item, quantity)\n current_list[item] = quantity\n current_list\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "def update (item, quantity)\n @groceries[item]=quantity\n end", "def update_item_quantity(current_list)\r\n puts \"Enter item to update: \"\r\n item_to_update = gets.chomp\r\n \r\n puts \"Enter a new quantity: \"\r\n new_item_qty = gets.chomp\r\n new_item_qty = new_item_qty.to_i\r\n \r\n if current_list.has_key?(item_to_update)\r\n current_list[item_to_update] = new_item_qty\r\n end\r\n \r\n current_list\r\nend", "def change_quantity(list, item, new_qty)\n list[item] = new_qty\nend", "def update_item(list, key, new_quant)\n list[key] = new_quant\n return list\nend", "def update_item(item,quantity_changed,first_list)\n first_list[item] = quantity_changed\n\nend", "def update(list, item, quantity)\n list[item] = quantity\n list\nend", "def update_quantity(item, list, quantity)\n list[item] = quantity\n return list\nend", "def update_quantity (quantity, item)\n $list.each do |list_item|\n if list_item[:item] == item\n list_item[:quantity] = quantity\n end\n end\nend", "def update_qty(list_items, item_name, new_qty)\n raise ArguementError.new(\"This item does not exist\") unless list_items.include?(item_name)\n list_items[item_name] = item_qty\nend", "def change_quantity(item_to_be_changed, quantity)\n $groceryhash[item_to_be_changed.to_sym] = quantity\n p $groceryhash\nend", "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list\nend" ]
[ "0.7888069", "0.764511", "0.7604691", "0.76039946", "0.7598769", "0.7592169", "0.7575722", "0.7571074", "0.75564104", "0.75564104", "0.7491865", "0.7490988", "0.7438961", "0.74265236", "0.73975", "0.7379802", "0.73691183", "0.7361545", "0.73510516", "0.73359215", "0.73170424", "0.7307935", "0.7285134", "0.72793996", "0.72761667", "0.7246059", "0.72142583", "0.71864307", "0.7177594", "0.717343", "0.7172983", "0.71545374", "0.7153043", "0.71387905", "0.71253675", "0.7123654", "0.71088326", "0.7082579", "0.7076944", "0.7074834", "0.70682454", "0.7062263", "0.7059452", "0.703564", "0.70335615", "0.7014734", "0.70093966", "0.69824517", "0.6980015", "0.6969186", "0.69544977", "0.69544977", "0.6949167", "0.6943534", "0.6936962", "0.6936962", "0.69337463", "0.6928437", "0.69281363", "0.69281363", "0.6927975", "0.6918632", "0.6913365", "0.69075406", "0.6905358", "0.68997073", "0.6898942", "0.6887002", "0.6886108", "0.68856525", "0.68845296", "0.68845296", "0.68827647", "0.6871021", "0.68701655", "0.68674034", "0.6863038", "0.6862837", "0.6860869", "0.6860573", "0.6859932", "0.6857166", "0.68508524", "0.6846162", "0.6840718", "0.6833741", "0.6833317", "0.6833195", "0.68324506", "0.68294567", "0.68291336", "0.6826605", "0.6821073", "0.68202037", "0.68143415", "0.68063605", "0.68014944", "0.680107", "0.67979836" ]
0.79688597
1
Method to print a list and make it look pretty input: new_hash steps: Use string padding and left/right justification to print hash output: prettified new hash
def print_list(new_hash) new_hash.each_pair {|key, value| puts "#{key}: #{value}"} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_list(hash)\n width= 50\n puts \"Shopping List\".center(width)\n puts \"\".rjust(50,\"-\")\n print \"Item\".ljust(width/2)\n print \"-\"\n puts \"Quantity\".rjust(width/2)\n puts \"\".rjust(50,\"-\")\n hash.each do |item, quantity|\n puts \"#{item.ljust(width/2)}-#{quantity.to_s.rjust(width/2)}\"\n end\nend", "def print_list(list_name)\r\n# input: hash name\r\n# steps: add dashes and spacing\r\np \"List:\"\r\nlist_name.each do |key, value|\r\n p \"#{key}: #{value}\"\r\nend\r\n# output: pretty hash listed\r\nend", "def hash\n @list.each_slice(16).map do |sub|\n \"%02x\" % sub.reduce(:^)\n end.join\n end", "def hash\n @list.each_slice(16).map do |sub|\n \"%02x\" % sub.reduce(:^)\n end.join\n end", "def pretty_list(hash)\r\n puts \"Grocery List:\"\r\n puts \" \"\r\n hash.each do |item_name, quantity|\r\n puts \"#{item_name}: #{quantity}\"\r\n end\r\nend", "def list_print(hash_items)\n printf(\"%20s%20s\\n\", '---------------','---------------')\n printf(\"%20s%20s\\n\", 'Item','Quantity')\n printf(\"%20s%20s\\n\", '---------------','---------------')\n\n hash_items.each do |x,y|\n printf(\"%20s%20s\\n\", x.upcase, y)\n end\n\nend", "def pretty_print_list(hash)\n\thash.each do |key, value|\n\t\tputs \"You need #{value}, #{key}\"\n\tend\nend", "def createlist(items)\n new_items = items.split(\" \")\n list = Hash.new\n new_items.each {|item| list[item] = 1}\n prettylist(list)\n # use print_list method\nend", "def prettyfie_list(hash)\r\n puts \"This is your current grocery list:\"\r\n puts \"\\n\"\r\n hash.each {|key, value| puts \"#{key} quantity = #{value}\" }\r\n puts \"\\n\"\r\nend", "def pretty_list(list)\n # new_list = \"\"\n # list.each { |item, quantity| new_list << \"You want #{quantity} #{item}\\n\" }\n # return new_list\n list.each { |item, quantity| puts \"You want #{quantity} #{item}\\n\" }\nend", "def pretty_list(list)\n puts \"Grocery List:\"\n list.each do |key, value|\n puts \"#{value} #{key}(s)\"\n end\n \nend", "def pretty_up(list)\n puts \"\\nHere is your grocery list: \"\n list.each do |key, value|\n puts value.to_s + ' ' + key.to_s\n end\nend", "def pretty_list(list)\r\n\tputs \"Grocery List\".center(30)\r\n\tlist.each do |item, quantity|\r\n\t\tputs \"#{item} \".ljust(20) + \"#{quantity}\".rjust(10)\r\n\tend\r\nend", "def pretty_print_user_list(list)\n total = 0\n data = []\n # Header row\n data.push('Asset', 'Total Value', 'Change % (Week)')\n list.user_pairs.each do |user_pair|\n data.push(user_pair.symbol)\n data.push(user_pair.valuation.format)\n data.push(user_pair.perchant_change_week.to_s)\n total += user_pair.valuation\n end\n\n data.push('', '', '')\n data.push('TOTAL:', total.format, '')\n data.push('', '', '')\n print_arrays(data, 3)\n end", "def pretty_list(groceries_list)\n\t# Print a line of text to lead into the list\n\tputs \"Here is your updated grocery list:\"\n\t# for each key and value in the list, print a string \n\t# containing the key and value\n\tgroceries_list.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "def print_pretty(new_list)\n puts \"Grocery List:\"\n new_list.each do |item, amount|\n \n puts \"#{item}: #{amount}\"\n end\nend", "def print_list(list)\n\tmax_index = list.length;\n\ti=1\n\twhile i<=max_index\n\tprint \"#{i}. #{hash_to_string(list[i-1])}\".center(get_winsize)\n\tprint \"\\n\"\n\ti +=1\n\tend\nend", "def print_list(hash)\n\tputs \"\" \n hash.each do |item, qty|\n puts \"#{item}: #{qty}\\n\"\n end\nend", "def print_list(new_list)\n\tnew_list.each do |key,value|\n\t\tputs \"#{value} #{key}\"\n\tend\nend", "def pretty_format\n pretty = \"\"\n sorted = @hash.sort_by { |name, arrays| name }\n\n sorted.each { |name, array|\n pretty.concat(name)\n pretty.concat(\": \")\n pretty.concat(\"#{@hash[name].join(\",\")}\\n\")\n\n }\n pretty\n\n ### FILL IN YOUR CODE HERE\n end", "def prettify_list(list)\n\tlist.each do |item, quantity|\n\t\tp \"You have #{quantity} #{item}\"\n\tend\nend", "def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend", "def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend", "def pretty_in_print(list)\n puts \"---------------------------------------\"\n puts \"These are the items we are gonna buy\"\n list.each {|item, qty| puts \"#{qty} pieces of #{item}\" }\nend", "def print_pretty (list)\n puts \"Grocery list\".upcase.center(50)\n puts \"-----------------\".center(50)\n list.each do |item,quantity|\n puts item.rjust(25) + \":\" + quantity.to_s.ljust(25) \n end\nend", "def pretty_list(list_name)\r\n list_name.each do |key, value|\r\n p \"#{key}: #{value}\"\r\n end\r\nend", "def print_pretty (list_name, list)\n p list_name.upcase.center (100)\n list.each do |x,y|\n p \"#{x.rjust(50)} : #{y.to_s.ljust(50)} \"\n end\nend", "def pretty_print(list)\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\nend", "def print_list(new_list)\r\n\tnew_list.each do |key,value|\r\n\t\tputs \"#{value} #{key}\"\r\n\tend\r\nend", "def pretty_list(list)\n\tlist.each { |item_name, item_quantity|\n\t\tputs \"You will need to purchase #{item_quantity} of #{item_name}.\"\n\t}\nend", "def print_pretty(list)\n list.each { |item, value| puts \"#{item} #{value}\" }\nend", "def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend", "def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend", "def print_friendly_list(list)\n puts \n puts \"Shopping List:\"\n puts \"----------------\"\n list.each {|key, value| puts \"#{key} #{value}\" }\n puts \nend", "def print_list(my_list)\r\n# input: \r\n \r\n# steps:\r\n# print to screen: iterate through hash item - quantity\r\n puts '------'\r\n puts \"Grocery list:\"\r\n my_list.each do |item, qty|\r\n puts \"#{item} - #{qty}\"\r\n end\r\n puts '-------'\r\n# output: each k,v pair printed surrounded by dashes\r\nend", "def printhash(hash)\n puts \"-----------------------\"\n hash.each { |item, qty| \n puts \"#{item},\\n qty: #{qty}\"\n puts \"\"\n }\n puts \"-----------------------\"\nend", "def print_list\n $old_list.to_h\n p \"Sooooo, you have\"\n $old_list.each {|key, val| p \"#{val} #{key}s\" }\n p \"Wow. It must feel good to be so loaded.\"\nend", "def printable\n asPrintable = \"\"\n doCount = 0 # way to keep track of the entries loop so a new line can be added to the end of the concat string\n @entries.sort.each do |keyWord, value|\n asPrintable += \"[#{keyWord}] \\\"#{value}\\\"\"\n if doCount < @entries.length - 1 # in order for test to pass, it cant have a extra line at the end\n asPrintable += \"\\n\" # only add one if not the last element of the hash\n end\n doCount += 1 # each loop adds one\n end\n asPrintable # return concat string\n end", "def print_list(item_list)\r\n\t# steps: iterate through each of hash element\r\n\t# print the header\r\n puts \"=========================\"\r\n\tputs \"== Grocery List So Far ==\"\r\n\tputs \"=========================\"\r\n\titem_list.each do |item,quantity|\r\n\t\t# display each element key and the value to make it look pretty\r\n\r\n\t\tputs item.ljust(20)+quantity.to_s\r\n\tend\r\nend", "def print_list()\n $list_hash.each do |current_item, quantity|\n p \"#{current_item.strip}: #{quantity.to_i}\"\n end\nend", "def pretty_list(list)\n list.each {|item, quantity| puts \"You need #{quantity} #{item}\"}\nend", "def print_hash(list)\nputs \"Current grocery list:\"\nputs \"---------------------\"\nlist.each do |item_name, item_quant|\n puts \" #{item_name}: #{item_quant}\"\nend\nend", "def print_list(grocery_hash={})\n\tputs \"*\" * 40\n\tputs \"Grocery List\"\n\tputs \"*\" * 40\n\tgrocery_hash.each do |food, quantity| puts \"#{food}:\".ljust(30) + \"#{quantity}\".rjust(10)\n\tend\n\tputs \"\"\nend", "def print_list(list_hash)\r\n\tlist_hash.each {|key, value| puts \"#{key}; qty: #{value}\" }\r\nend", "def pretty(list)\n list.each {|item, quantity| p \"You need to buy #{quantity} of #{item}.\"}\nend", "def prettify(list)\r\n\r\n list.each do |item, quantity|\r\n puts \"There are #{quantity} #{item} in the list.\"\r\n end\r\n\r\nend", "def printable\n\t\t@entries.sort.map do |key, value|\n\t\t\t\"[#{key}] \\\"#{value}\\\"\"\n\t\tend.join(\"\\n\")\n\tend", "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "def list_to_print(title,list)\n line = \"\" \n 1.upto(title.size){line << \"-\"}\n title = title + \"\\n\" + line + \"\\n\"\n return title + (list.collect {|x| \" => #{x}\" }).join(\"\\n\")\n end", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def pretty_print(list,num)\n a = list.dup #otherwise slice! will eat your incoming list\n while a.length > 0\n STDERR.puts a.slice!(0,num).join(\" \")\n end\nend", "def print_list(hash)\r\n\thash.each do |item, quantity|\r\n\t\tputs \"#{item}, #{quantity}\"\r\n\tend\r\nend", "def format_list(list)\n puts \"Your grocery list:\"\n list.each do |key, value|\n puts \"#{key}: #{value}\"\n end\nend", "def format_list(items); end", "def printable\n \tprint_this = []\n \t@entries.each{ |k,v| print_this << \"[#{k}] \\\"#{v}\\\"\\n\" }\n \tprint_this.sort.join.chomp.chomp\n end", "def pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend", "def print_list(fund_hash)\n fund_hash[:list].each do |item|\n puts \"Name: #{item[:name]}\"\n puts \"Description: #{item[:description]}\"\n puts \"Target: $#{item[:target]}\"\n puts \"Balance: $#{item[:balance]}\"\n puts \"Percentage: #{item[:percentage]}%\"\n puts \"Importance: #{item[:importance]}\"\n puts \"-------------------------\"\n end\n end", "def print_list(hash)\n hash.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend", "def pretty_list(list)\n list.each{|food, quantity| puts \"Please get #{quantity} #{food}.\"}\n puts \"Thanks!\"\nend", "def print_list(hash)\n hash.each do |item, quantity|\n puts item + \" : \" + quantity.to_s\n end\n end", "def pretty_output #two columns\n alphabetical_keys = @concordance_hash.keys.sort\n half = (alphabetical_keys.length - 1) / 2\n alphabetical_keys[0..half].each_with_index do |key, idx|\n value = \"{\" + @concordance_hash[key][0].to_s + \":\" +\n @concordance_hash[key][1..-1].to_s.delete(\"[] \") + \"}\"\n\n key2 = alphabetical_keys[1 + idx + half]\n value2 = \"{\" + @concordance_hash[key2][0].to_s + \":\" +\n @concordance_hash[key2][1..-1].to_s.delete(\"[] \") + \"} \\n\"\n if 1 + idx + half >= alphabetical_keys.length\n value2 = \"\\n\"\n end\n\n printf \"%-15s %-20s %-15s %s\", key, value, key2, value2\n end\n end", "def list_formatter(list)\n\tlist.each do |item, quanity|\n\t\tputs \"we need #{quanity} of #{item}\"\n\tend\nend", "def print_list(list)\r\n puts \"-\"*20\r\n list.each do |item,quantity|\r\n puts \"Item:#{item} quantity:#{quantity}\"\r\n end\r\n puts \"-\"*20\r\n list\r\nend", "def print_list(hash)\n count = 1\n hash.each do |key, value|\n p count.to_s + \") \" + key + \": \" + value.to_s\n count += 1\n end\nend", "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend", "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend", "def render_hash(hsh)\n str = \"\"\n indiff_hsh = hsh.with_indifferent_access\n indiff_hsh.keys.sort.each do |key|\n str << \"#{key}: \"\n value = indiff_hsh[key]\n PP::pp(value, str)\n end\n str\n end", "def pretty(list)\n list = list.map {|k, v| k.capitalize}\n puts \"Grocery list:\" + list\nend", "def to_pretty\r\n\t\t\ta = dup\r\n\t\t\ts = \"\"\r\n\t\t\ta.each_with_index {|i, ind|\r\n\t\t\t\ta[ind].each_with_index {|ii, iind|\r\n\t\t\t\t\ta[ind][iind].each_with_index {|iii, iiind|\r\n\t\t\t\t\t\ts << iii\r\n\t\t\t\t\t\ts << \" &\\n\" unless (iiind == (a[ind][iind].size - 1))\r\n\t\t\t\t\t}\r\n\t\t\t\t\ts << \"\\n| \" unless iind == (a[ind].size - 1)\r\n\t\t\t\t}\r\n\t\t\t\ts << \" ;\\n\\n\" unless ind == (a.size - 1)\r\n\t\t\t}\r\n\t\t\treturn s\r\n\t\tend", "def print_sorted_list(sorted_list, format = Format::Normal, minimumSize = 0)\n\t\tif format.eql?(Format::Normal)\n\t\t\tsorted_list.each do |key, value| \n\t\t\t\tif value > minimumSize\n\t\t\t\t\tputs \"#{key} size is #{commify(value)}\" \n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tsorted_list.each do |key, value| \n\t\t\t\tif value > minimumSize\n\t\t\t\t\tputs \"#{key}\\t#{commify(value)}\" \n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def print_pretty(grocery_list)\r\n\tgrocery_list.each do |item, quantity| \r\n\t\tputs \"you bought #{quantity} #{item}\"\r\n\tend\r\nend", "def print_list(hash)\n puts \"Grocery list:\"\n hash.each {|item, quantity| puts \"#{item} - #{quantity}\"}\nend", "def print_list(list)\n list_hash = list\n puts \"This is our grocery list: \"\n list_hash.each do |item_key, quant_value|\n puts \"#{item_key}: #{quant_value}\"\n end\nend", "def pretty_list(grocery_list)\r\n puts \"Your Grocery List for next week!\"\r\n grocery_list.each do |item, num|\r\n puts \"#{item} qty #{num}\"\r\n end\r\n \r\nend", "def print_list(list)\r\n puts \"_-\" *25 + \"\\n\\n\"\r\n puts \"Here is your Grocery List: \\n\\n\"\r\n list.each do |item, quantity|\r\n puts \"\\tItem: #{item} \\tAmount: #{quantity}\"\r\n end\r\n puts \"_-\" *25\r\nend", "def _non_summary_list(list)\n list_for_display = []\n list.each do |item|\n list_for_display += [item.to_hash]\n end\n\n list_for_display\n end", "def hash_print (hash)\n\thash.each do |k,v|\n\t\tputs \"#{k} #{v} students\"\n\tend\nend", "def print_list(list_hash)\n list_hash.each do |key,value|\n puts \"The quantity of #{key} is: #{value}\"\n end\nend", "def print_list(hash)\n hash.each do |x,v|\n puts \"the item is #{x} and the quantity is #{v}.\"\n end\nend", "def hash_printer(hash)\n puts \"Grocery List\"\n hash.each do |key, value|\n puts \"You need #{value} #{key}(s).\"\n end\nend", "def print_list(hash)\n hash.each { |key, value| puts \"#{value}: #{key}\" }\nend", "def grocery_printed_pretty(groceryhash)\n $groceryhash.map do |food_item, food_quantity|\n puts \"#{food_item.to_s} : #{food_quantity}\"\n end\nend", "def print_list(list)\n puts \"Your shopping list:\"\n list.each do |k, v|\n puts \"#{k} -- #{v}\"\n end\nend", "def print_hash(hash)\n hash.inject(\"\") { |s, (k, v)| \"#{s} #{k}: #{v}.\" }\nend", "def print_hash(hash)\n hash.inject(\"\") { |s, (k, v)| \"#{s} #{k}: #{v}.\" }\nend", "def inspect\t\t\n\t\tmsg = '{'\n\t\t@hash.each_with_index do |info, index|\n\t\t\tmsg += info.to_s\n\t\t\tmsg += \", \" if @hash.size > 1 and index + 1 < @hash.size \n\t\tend\n\t\tmsg += '}'\n\t\tmsg\n\tend", "def print_list(list)\n puts \"Name \\t\\t Quantity\"\n list.each do |key, value|\n puts \"#{key} \\t\\t #{value}\"\n end\nend", "def pretty_list(grocery_list)\n puts \"Shopping List\"\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n puts \"Happy Shopping!\"\nend", "def printHTML(entriesList, out)\n id = 0\n entriesList.each { |heading,entries|\n out.puts \"<h3>#{heading}</h3>\" if heading\n out.puts \"<ul>\"\n entries.each { |entry|\n out.puts \"<li>\"+entry.toHTML(id)+\"</li>\"\n id += 1\n }\n out.puts \"</ul>\"\n }\nend", "def createlist(str)\r\n# steps:\r\n# break the string into an array\r\n items = str.split\r\n item_list = {}\r\n\r\n\t# iterate through array and build hash\r\n items.each do |item|\r\n\r\n\t\t# iterate through array and build hash\r\n\t\t# set default quantity to 1\r\n \titem_list[item] = 1\r\n end\r\n # print the list to the console [the last method that print a list and make it look pretty]\r\n print_list(item_list)\r\n\r\n # output: the hash\r\n return item_list\r\nend", "def print_list(hash)\n puts \"Grocery List\"\n hash.each do |item|\n puts item\nend\nend", "def outputting(num, sorted_list)\n\tprint \"Output #{num}:\\n\"\n\tsorted_list.each{|hash| print hash.values.join(\" \"), \"\\n\"}\n\tprint \"\\n\"\nend", "def print_list (list)\nlist.each {|k,v|puts \"#{k}:#{v}\"}\nend", "def print_list(complete_list)\n puts \"Here is a list of things of things you need to buy and the amount needed:\"\n complete_list.each {|key, value| puts \"#{value} #{key}\" }\nend", "def print_list(list)\r\n list.each {|key,value| puts \"You need #{value} #{key}(s).\"}\r\nend", "def hash\n \"#{membership} #{formatted_price}\"\n end", "def format_list_item(out, options)\n if options[:list] == :ul\n out << \"#{'*' * (options[:ul] + 1)} \"\n elsif options[:list] == :ol\n number = options[:number]\n options[:number] = number.next\n out << \"#{number}. \"\n end\n end" ]
[ "0.6861356", "0.67829186", "0.6679124", "0.6679124", "0.66731256", "0.65380496", "0.6487519", "0.6483313", "0.64092034", "0.639326", "0.63731575", "0.6354653", "0.6327226", "0.6285449", "0.62683225", "0.62461895", "0.6237056", "0.621643", "0.6215804", "0.6183054", "0.6180052", "0.6129701", "0.60931844", "0.60769", "0.607411", "0.6065114", "0.6057849", "0.60530746", "0.6036809", "0.6036411", "0.5998579", "0.59975547", "0.59975547", "0.5986466", "0.5967281", "0.59436476", "0.5896098", "0.5895127", "0.588212", "0.5882025", "0.58811325", "0.58767676", "0.58701867", "0.5841646", "0.58415127", "0.58406216", "0.5825057", "0.57803774", "0.5774932", "0.57729214", "0.57729214", "0.57729214", "0.57729214", "0.5768479", "0.57130134", "0.5706017", "0.5703649", "0.5697465", "0.56971383", "0.56716436", "0.5658633", "0.56474227", "0.5621353", "0.5615934", "0.5610772", "0.5585703", "0.55752367", "0.55752367", "0.5559454", "0.5538437", "0.5513155", "0.55108714", "0.5510362", "0.5500016", "0.54956317", "0.5491836", "0.54708457", "0.54533136", "0.54419553", "0.54341996", "0.54326373", "0.5430607", "0.54270405", "0.5425209", "0.54230636", "0.54191273", "0.54191273", "0.5418107", "0.54128724", "0.53959876", "0.5376737", "0.5371414", "0.5368554", "0.5365066", "0.53545076", "0.5350515", "0.5343443", "0.53357214", "0.5332888" ]
0.5746706
55
Find the largest product in a row
def left_to_right_helper(arr) largest_prod_so_far = 0 for num in (1..16) curr_prod = arr[num] * arr[num + 1] * arr[num + 2] * arr[num + 3] if curr_prod > largest_prod_so_far largest_prod_so_far = curr_prod end end return largest_prod_so_far end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def largest_product()\n 0.upto(GRID_SIZE - 1) do |x|\n 0.upto(GRID_SIZE - 1) do |y|\n products_at_point(x,y)\n end\n end\n @largest_product\n end", "def greatestProduct(num)\n numArr = num.to_s.split('')\n windowSize = 12\n maxProduct = -1\n for currentWindowStartIndex in 0...(numArr.count - windowSize) do\n currentProduct = numArr[currentWindowStartIndex..(currentWindowStartIndex + windowSize)].inject(1) { |result, element | result * element.to_i }\n if currentProduct > maxProduct\n maxProduct = currentProduct\n end\n end\n return maxProduct\nend", "def highest_product(arr)\n\tfirst = -1.0/0\n\tsecond = -1.0/0\n\tthird = -1.0/0\n\tfor i in 0..arr.length-1\n\t\telement = arr[i]\n\t\tif element >= first\n\t\t\tfirst = element\n\t\telsif element > second\n\t\t\tsecond = element\n\t\telsif element > third\n\t\t\tthird = element\n\t\tend\n\tend\n\tfirst * second * third\nend", "def greatest_product(n)\n idx = 0\n largest_product = 0\n\n loop do\n sum = n[idx, 5].chars.map(&:to_i).inject { |mem, num| mem * num }\n largest_product = sum if sum > largest_product\n idx += 1\n break if idx >= n.length - 4\n end\n largest_product\nend", "def largest_product(array)\r\n largest_product_so_far = array[0] * array[1] * array[2]\r\n i = 0\r\n\r\n while i < array.length\r\n j = i + 1\r\n while j < array.length \r\n k = j + 1\r\n while k < array.length\r\n if array[i] * array[j] * array[k] > largest_product_so_far\r\n largest_product_so_far = array[i] * array[j] * array[k]\r\n end\r\n k += 1\r\n end\r\n j += 1\r\n end\r\n i += 1\r\n end\r\n\r\n return largest_product_so_far\r\n\r\nend", "def highest_prod(arr)\n\n highest_prod_2 = (arr[0] * arr[1])\n highest = [arr[0], arr[1]].max\n lowest_prod_2 = (arr[0] * arr[1])\n lowest = [arr[0], arr[1]].min\n\n highest_prod_3 = (arr[0] * arr[1] * arr[2])\n\n i = 3\n while i < arr.length\n current_num = arr[i]\n\n highest_prod_3 = [(highest_prod_3), (highest_prod_2*current_num), (lowest_prod_2*current_num)].max\n\n highest_prod_2 = [highest_prod_2, (highest*current_num)].max\n\n lowest_prod_2 = [lowest_prod_2, (lowest*current_num)].min\n\n highest = [highest, current_num].max\n\n lowest = [lowest, current_num].min\n\n i += 1\n end\n\n highest_prod_3\nend", "def product_right\n unless @col > 16 \n product = @arr[@row][@col] * @arr[@row][@col + 1] * @arr[@row][@col + 2] * @arr[@row][@col + 3]\n check_new_max(product)\n end \nend", "def max_product(nums)\n pos_hash = Hash.new {|h,k| h[k] = []}\n\n nums.each_with_index do |num, idx|\n pos_hash.each do |old_num, old_val|\n old_val.push(old_val.last * num)\n end\n pos_hash[idx].push(num)\n end\n\n pos_hash.values.flatten.max\n\nend", "def max_product(nums)\n min = max = 1\n max_product = nums[0]\n nums.each do |num|\n min, max = [num, min * num, max * num].minmax\n max_product = [max, max_product].max\n end\n max_product\nend", "def max_of_product_linear(arr)\n max = -99999\n curr_product = 0\n n = arr.length\n left = 0\n right = n - 1\n while left < right\n if arr[left] < arr[right]\n curr_product = arr[left]*(right-left)\n left += 1\n end\n if arr[left] > arr[right]\n curr_product = arr[right] *(right-left)\n right -= 1\n end\n max = [max,curr_product].max\n end\n max\nend", "def find_max(array)\n max = 0\n array.each do |subarray|\n subarray.each_cons(4) do |chunk|\n product = quad_product(chunk)\n max = product if product > max\n end\n end\n max\n end", "def left_to_right_approach\n largest_prod_of_all_rows = 0\n for each_row in (0..19)\n curr_largest_prod_in_row = left_to_right_helper($grid_of_numbers[each_row])\n if curr_largest_prod_in_row > largest_prod_of_all_rows\n largest_prod_of_all_rows = curr_largest_prod_in_row\n end\n end\n \n return largest_prod_of_all_rows\nend", "def largest_product_in_grid(grid_input, length)\r\n\t# copy input since grid will be modified\r\n\tgrid = grid_input.dup.map(&:dup)\r\n\t# for each row in grid\r\n\tgrid.each_with_index do |row, grid_idx|\r\n\t\t# map each num in row to an array of the product of each of the four chains beginning at num\r\n\t\trow.map!.with_index do |num, num_idx|\r\n\t\t\t# build the 4 chains of four elements (going right, right-down, down, and left-down)\r\n\t\t\tarray = (0...length).each_with_object([]) do |j, arr|\r\n\t\t\t\t# get elements j distance away from num\r\n\t\t\t\tarr << [\r\n\t\t\t\t\tgrid[grid_idx][num_idx + j].to_i,\t\t\t#right\r\n\t\t\t\t\tgrid[grid_idx + j].to_a[num_idx + j].to_i,\t#down-right\r\n\t\t\t\t\tgrid[grid_idx + j].to_a[num_idx].to_i,\t\t#down\r\n\t\t\t\t\t#down-left... need to avoid using a negative index to retrieve element\r\n\t\t\t\t\tnum_idx - j < 0 ? 0 : grid[grid_idx + j].to_a[num_idx - j].to_i\r\n\t\t\t\t\t]\r\n\t\t\tend\r\n\t\t\t# array now contains four arrays, the first being the 4 nums 0 distace away,\r\n\t\t\t# the next being the 4 nums 1 distance away (in each direction), etc\r\n\t\t\tarray = array.transpose # build the actual four chains\r\n\t\t\tarray.map{|chain| chain.inject(:*)} # get product of each chain\r\n\t\tend\r\n\tend\r\n\t# each num in grid is now replaced with an array of 4 products:\r\n\t# one for each of the chains going right, down-right, down, and down-left from that num\r\n\r\n\t#get largest product\r\n\tgrid.flatten.max\r\nend", "def largest_product(num_list)\n num_list.sort!\n biggest_num = num_list.pop\n second_num = num_list.pop\n\n max_product = biggest_num * second_num\nend", "def max_product(nums)\n return 0 if !nums or nums.length <= 0\n maxherepre, minherepre, maxsofar = nums[0], nums[0], nums[0]\n\n 1.upto(nums.length-1) do |i|\n item = nums[i]\n minhere, maxhere = [maxherepre*item, minherepre*item, item].minmax\n maxsofar = maxhere if maxhere > maxsofar\n minherepre, maxherepre = minhere, maxhere\n end\n\n maxsofar\nend", "def highest_product( array )\n\nend", "def greatest_product(n, start_index = 0, greatest_product = 0)\n while start_index < (n.length - 4)\n product = n[start_index, 5].chars.map(&:to_i).reduce(:*)\n greatest_product = product if product > greatest_product\n start_index += 1\n end\n greatest_product\nend", "def max_product(num)\n all_sub = sub(num)\n product_sub = []\n for i in 0...all_sub.length\n product_sub << product(all_sub[i])\n end\n\n product_sub.max\nend", "def greatest_product(n)\r\n\r\n num_array = n.gsub(/\\n/,'').split('').map(&:to_i)\r\n max = 0\r\n i = 0\r\n while i < num_array.length - 13\r\n sum = num_array[i..i+12].reduce(:*)\r\n if sum > max\r\n max = sum\r\n end\r\n i += 1\r\n end\r\n max\r\nend", "def max_product_of_four_adjacent_numbers_from_collection_of_arrays(lines)\n max_product = 1\n \n lines.each {|line|\n line_max = max_product_of_four_adjacent_numbers_from_array(line)\n max_product = line_max if (max_product < line_max)\n }\n \n return max_product\nend", "def find_biggest_product_of_three(input)\n highest_product_o_3 = (input[0] * input[1] * input[2])\n a = input.shift\n b = input.shift\n highest = nil\n lowest = nil\n if a > b\n highest = a\n lowest = b\n else\n highest = b\n lowest = a\n end\n highest_product_o_2 = (a * b)\n highest = a\n lowest_product_o_2 = highest_product_o_2\n lowest = b\n input.each do |number|\n if (number * highest_product_o_2) > highest_product_o_3\n highest_product_o_3 = (number * highest_product_o_2)\n elsif (number * lowest_product_o_2) > highest_product_o_3\n highest_product_o_3 = (number * lowest_product_o_2)\n end\n if (number * highest) > highest_product_o_2\n highest_product_o_2 = (number * highest)\n elsif (number * lowest) < lowest_product_o_2\n lowest = number\n end\n if number > highest\n highest = number\n elsif number < lowest\n lowest = number\n end\n end\n p highest_product_o_3\nend", "def find_largest_product(array)\n start = 0\n finish = 3\n greatest = 0\n \n until finish > 19 || finish > array.size do\n sum = array[start..finish].reduce{ |product, n| product * n }\n greatest = sum if sum > greatest\n start += 1\n finish += 1\n end\n greatest\n end", "def highest_product_of_three(arr)\n return arr.reduce(:*) if arr.length === 3\n\n smallest_negative = nil\n second_smallest_negative = nil\n\n largest_num = 0\n second_largest_num = 0\n third_largest_num = 0\n\n arr.each do |num|\n if num >= 0\n if num > largest_num\n third_largest_num = second_largest_num\n second_largest_num = largest_num\n largest_num = num\n elsif num > second_largest_num\n third_largest_num = second_largest_num\n second_largest_num = num\n elsif num > third_largest_num\n third_largest_num = num\n end\n else\n \n if smallest_negative.nil? || num < smallest_negative\n smallest_negative = num\n elsif second_smallest_negative.nil? || num < second_smallest_negative\n second_smallest_negative = num\n end\n end\n end\n\n option_1 = nil #two negatives, one positive\n option_2 = nil\n if smallest_negative && second_largest_num\n option_1 = smallest_negative * second_smallest_negative * largest_num\n option_2 = largest_num * second_largest_num * third_largest_num\n else\n return largest_num * second_largest_num * third_largest_num\n end\n option_1 > option_2 ? option_1 : option_2\nend", "def findLargestProduct\n \n solution = 0\n last = 4\n n = \"73167176531330624919225119674426574742355349194934969835203127745063262395783180169\n 8480186947885184385861560789112949495459501737958331952853208805511125406987471585238630\n 5071569329096329522744304355766896648950445244523161731856403098711121722383113622298934\n 2338030813533627661428280644448664523874930358907296290491560440772390713810515859307960\n 8667017242712188399879790879227492190169972088809377665727333001053367881220235421809751\n 2545405947522435258490771167055601360483958644670632441572215539753697817977846174064955\n 1492908625693219784686224828397224137565705605749026140797296865241453510047482166370484\n 4031998900088952434506585412275886668811642717147992444292823086346567481391912316282458\n 6178664583591245665294765456828489128831426076900422421902267105562632111110937054421750\n 6941658960408071984038509624554443629812309878799272442849091888458015616609791913387549\n 9200524063689912560717606058861164671094050775410022569831552000559357297257163626956188\n 2670428252483600823257530420752963450\"\n dataArray = n.chars.map(&:to_i)\n\n (0..995).each do |start| \n possible_sol = dataArray[start..last].inject(:*)\n \tsolution = possible_sol if possible_sol > solution \n \tlast += 1\n end\n\n solution\n\nend", "def max_value\n max = 0\n\n @matrix.each do |row|\n row_max = row.max\n max = row_max if row_max > max\n end\n\n max\n end", "def greatest_prod(file_name)\n f1 = File.open(file_name)\n greatest_prod = prod = 1\n while(!f1.eof)\n line = f1.readline.chomp\n l = line.length\n for i in 0..l-6\n prod = 1\n 5.times do\n prod = prod*line[i].chr.to_i\n i+=1 \n end\n greatest_prod = prod if(greatest_prod < prod)\n end\n end\n greatest_prod \nend", "def product_of_three2(arr)\n third, second, first = [arr[0], arr[1], arr[2]].sort\n max_product = first * second * third\n arr.each_with_index do |num, idx|\n next if [0,1,2].include?(idx)\n let sub_products = [[third, second], [second, first], [first, third]]\n sub_products.each do |product|\n if (product[0] * product[1] * num > max_product)\n max_product = product[0] * product[1] * num\n first, second, third =[product[0], product[1], num]\n end\n end\n end\n return max_product\nend", "def largest_product(n, c)\n\tmax = 0\n\tidx = 0\n\twhile idx < n.length\n\t\tproduct = n[idx..(idx + c - 1)].split(\"\").map {|i| i.to_i}.reduce(:*)\n\t\tif product > max\n\t\t\tmax = product\n\t\tend\n\t\tidx += 1\n\tend\n\treturn max\nend", "def max_product_quadratic(data)\n winner = data[0]*data[1]\n (0..data.length-2).each do |i|\n (i+1..data.length-1).each do |j|\n winner = data[i]*data[j] if data[i]*data[j] > winner\n end\n end\n return winner\nend", "def highest_product_of_three(array)\n negative_count = array.select { |value| value < 0 }\n array.map! { |value| value.abs }.sort! if negative_count.length.even?\n solution = 1\n array.max(3).each { |max| solution *= max }\n p solution\nend", "def top_to_bottom_approach\n largest_prod_of_all_cols = 0\n for each_row in (0..15)\n for each_col in (0..19)\n curr_prod_in_col = $grid_of_numbers[each_row][each_col] * $grid_of_numbers[each_row + 1][each_col] * $grid_of_numbers[each_row + 2][each_col] * $grid_of_numbers[each_row + 3][each_col]\n if curr_prod_in_col > largest_prod_of_all_cols\n largest_prod_of_all_cols = curr_prod_in_col\n end\n end\n end\n \n return largest_prod_of_all_cols\nend", "def vertical_max(grid, rows, cols, length)\n max = 0\n # For each column\n (0...cols).each do |x|\n # Each entry in the column\n ((length-1)...rows).each do |y|\n # Multiply that entry and the length-1 entries before it and compare\n p = ((y-length+1)..y).inject(1) {|product, i| product * grid[i][x]}\n max = p if max < p\n end\n end\n max\n end", "def maximal_square(a)\n\treturn 0 if a.size == 0 || a == nil\n\trows = a.size\n\tcols = a[0].size\n\tlargest = 0\n\tdp = Array.new(rows+1) { Array.new(cols+1) }\n\tfor i in 0..rows do\n\t\tfor j in 0..cols do\n\t\t\t# Initialize first row and column of matrix with 0\n\t\t\tif i==0 || j==0\n\t\t\t\tdp[i][j] = 0 \n\t\t\t# If matrix cell value for specific row and cell is 1, take minimum of left, right, diagonal and add 1.\n\t\t\t# As all these 3 directions should be checked and must contain 1. Store it to dp corresponding cell.\n\t\t\t# Keep track of largest matrix by comparing with dp cell value.\n\t\t\telsif a[i-1][j-1] == '1'\n\t\t\t\tdp[i][j] = [ dp[i-1][j], dp[i][j-1], dp[i-1][j-1] ].min + 1\n\t\t\t\tlargest = dp[i][j] if dp[i][j] > largest\n\t\t\t# If element equals 0 then put 0 in dp corresponding cell\n\t\t\telse\n\t\t\t\tdp[i][j] = 0\n\t\t\tend\t\n\t\tend\t\n\tend\t\n\treturn (largest*largest) # Return area by multiplying largest element to itself.\nend", "def max\n max = get(0,0)\n for i in 0...@filas\n for j in 0...@columnas\n if (get(i,j) > max)\n max = get(i,j)\n end\n end\n end\n max\n end", "def highest_value_square(values)\n @current_row = values.max_by{ |k,v| k }[1][0]\n @current_column = values.max_by{ |k,v| k }[1][1]\nend", "def horizontal_max(grid, rows, cols, length)\n max = 0\n # For each column\n (0...rows).each do |y|\n # Each entry in the column\n ((length-1)...cols).each do |x|\n # Multiply that entry and the length-1 entries before it and compare\n p = ((x-length+1)..x).inject(1) {|product, i| product * grid[y][i]}\n max = p if max < p\n end\n end\n max\n end", "def get_maximum_price(product)\n if product.has_variants?\n product.variants.map(&:price).sort.last\n else\n product.price \n end\n end", "def largest_product_in_a_grid(array, n)\r\n \r\n products_from_left_to_right = array.map{|arr| arr.map{|x| x.to_i }}.map{|arr| arr.each_cons(n).to_a }.flatten(1).max_by{|arr| arr.reduce(:*) }\r\n \r\n products_up_and_down = array.map{|arr| arr.map{|x| x.to_i }}.transpose.map{|arr| arr }.map{|arr| arr.each_cons(n).to_a }.flatten(1).max_by{|arr| arr.reduce(:*) }\r\n \r\n grid1 = array.map{|arr| arr.map{|x| x.to_i }}.map{|arr| arr.reverse}\r\n diag1 = Array.new\r\n until diag1.size == 20 \r\n diag1 << (0..grid1.size - 1).map {|i| grid1[i][i] }\r\n grid1.map{|arr| arr.rotate! }\r\n end \r\n products_diagonally_opposite = diag1.map{|arr| arr.each_cons(n).to_a }.flatten(1).max_by{|arr| arr.reduce(:*) }\r\n \r\n\r\n grid2 = array.map{|arr| arr.map{|x| x.to_i }}\r\n diag2 = Array.new\r\n until diag2.size == 20 \r\n diag2 << (0..grid2.size - 1).map {|i| grid2[i][i] }\r\n grid2.map{|arr| arr.rotate! }\r\n end \r\n products_diagonally = diag2.map{|arr| arr.each_cons(n).to_a }.flatten(1).max_by{|arr| arr.reduce(:*) }\r\n \r\n winner = [products_diagonally, products_diagonally_opposite, products_up_and_down, products_from_left_to_right]\r\n winner = winner.max_by{|arr| arr.reduce(:*)}.reduce(:*)\r\nend", "def larg_palin_product\n max_product = 1\n (100...1000).each do |x|\n (100...1000).each do |y|\n max_product = x*y if (isPalindome x*y) && (x*y > max_product)\n end\n end\n max_product\nend", "def max\n max = @valor[0][0]\n i=0\n\tself.fil.times do |i|\n\t j=0\n\t self.col.times do |j|\n\t if (@valor[i][j] > max)\n\t\t max= @valor[i][j]\n\t end\n\t j=j+1\n\t end\n\ti=i+1\n end\n max\n end", "def compute\n # the position of the largest integer in the current row\n index = 0\n\n # the maximum sum\n maximum_sum = 0\n\n @triangle.each_with_index do |line, line_index|\n # the first line is guaranteed to have 1 number, so that is the initial maximum_sum\n if line_index == 0\n maximum_sum = line[index]\n else\n # get the adjacent integers in the next row\n left_integer = line[index]\n right_integer = line[index + 1]\n # get the maximum integer, add it to the sum, and update the index to point to it\n if left_integer >= right_integer\n maximum_sum += left_integer\n # index stays the same\n else\n maximum_sum += right_integer\n index += 1\n end\n end\n end\n \n maximum_sum\n end", "def find_greatest_product(filename, product_length)\n digits = read_digits(filename)\n\n greatest = 0\n for i in 0..(digits.length - product_length)\n product = digits.slice(i, product_length).reduce(1, :*)\n if product > greatest\n greatest = product\n end\n end\n\n greatest\nend", "def largest_prime_factor(num)\n #prime_division returns an array of 2 element arrays containing prime factorization - [[2, 1], [5, 2]]\n #flat_map contatenates the 2 element arrays into a single array [2, 5, 5]\n array = Prime.prime_division(num).flat_map { |factor, power| [factor] * power }\n\n largest = 0\n array.each do |i|\n if i > largest\n largest = i\n end\n end\n return largest\nend", "def largest_possible_product(num_of_digits)\n return ((\"9\" * num_of_digits).to_i) ** 2\nend", "def diagonal_max(grid, rows, cols, length)\n max = 0\n # For each column\n ((length-1)...rows).each do |y|\n # Each entry in the column\n ((length-1)...cols).each do |x|\n # Multiply that entry and the length-1 entries before it and compare\n p = (0...length).inject(1) {|product, i| product * grid[y-i][x-i]}\n max = p if max < p\n end\n end\n (0...(rows-length)).each do |y|\n # Each entry in the column\n ((length-1)...cols).each do |x|\n # Multiply that entry and the length-1 entries before it and compare\n p = (0...length).inject(1) {|product, i| product * grid[y+i][x-i]}\n max = p if max < p\n end\n end\n max\n end", "def max_product(numbers, n)\n max_product = 0\n num_array = numbers.map( &:to_i )\n subset_size = 0..n-1\n\n while( num_array.length >= n )\n subset = num_array[subset_size]\n tmp_product = subset.reduce(:*)\n if tmp_product > max_product\n max_product = tmp_product \n end\n num_array.shift\n end\n max_product\nend", "def GetLargestPalindromic\r\n @product = 0\r\n \r\n @size.downto(1) { |i|\r\n @size.downto(1) { |j|\r\n @product = i * j\r\n \r\n if IsPalindromic(@product)\r\n puts \"Largest Palindromic = #{@product}\"\r\n return\r\n end\r\n }\r\n }\r\n\r\n puts \"Largest Palindromicaa = #{@product}\"\r\n end", "def best_result(triplet)\n triplet.max\nend", "def max(dim=0)\n reduce_along_dim(dim, -1.0*Float::MAX) do |max, sub_mat|\n max * (max >= sub_mat) + ((max)*0.0 + (max < sub_mat)) * sub_mat\n end\n end", "def max_product(num, adjacent_digits)\r\n\tnum_array = ((num.to_s).split '').map { |i| i.to_i }\r\n\tmax_product_of_sub_array = 0\r\n\tmax_sub_array = []\r\n\tindex = 1\r\n\twhile (num_array.length - index) >= (adjacent_digits - 1)\r\n\t\tsub_array = num_array[(num_array.length-index - (adjacent_digits - 1))..(num_array.length-index)]\r\n\t\t\r\n\t\tproduct_of_sub_array = sub_array.reduce(:*)\r\n\t\tif product_of_sub_array > max_product_of_sub_array\r\n\t\t\tmax_sub_array = sub_array\r\n\t\t\tmax_product_of_sub_array = product_of_sub_array\r\n\t\tend\r\n\t\t\r\n\t\tindex += 1\r\n\tend\r\n\tputs max_sub_array.to_s\r\n\treturn max_product_of_sub_array\r\nend", "def max_product(nums)\n min = 1\n max = 1\n result = -1.0/0.0\n nums.each do |num|\n puts \"prev_min: #{prev_min = min}\"\n # prev_min = min\n puts \"min: #{min = [min*num, max*num, num].min}, min*num: #{min*num}, max*num: #{max*num}, num: #{num}\"\n # min = [min*num, max*num, num].min\n puts \"max: #{max = [prev_min*num, max*num, num].max}, prev_min*num: #{prev_min*num}, max*num: #{max*num}, num: #{num}\"\n # max = [prev_min*num, max*num, num].max\n puts \"result: #{result = [max, result].max}\"\n # result = [max, result].max\n end\n result\nend", "def max\n\t\tm = self.mat[0][0]\n\t\tfor i in (0...@fil.to_i)\n\t\t\t#for j in (0...@col.to_i)\n\t\t\t@col.to_i.times do |j| \n\t\t\t\t\t\t\t\n\t\t\t\tif (self.mat[i][j] > m)\n\t\t\t\t\tm = self.mat[i][j]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn m\n\tend", "def right_to_diagonal_left_approach\n largest_prod = 0\n\n for each_row in (0..15)\n for col in (0..19)\n each_col = 19 - col\n a = $grid_of_numbers[each_row][each_col]\n b = $grid_of_numbers[each_row+1][each_col-1]\n c = $grid_of_numbers[each_row+2][each_col-2]\n d = $grid_of_numbers[each_row+3][each_col-3]\n #puts \"#{a} #{b} #{c} #{d}\"\n curr_prod = a*b*c*d\n if curr_prod > largest_prod\n largest_prod = curr_prod\n end\n end\n end\n \n return largest_prod\nend", "def products_at_point(x,y)\n -1.upto(1) do |j|\n -1.upto(1) do |k|\n unless (j == 0 && k == 0)\n product = 1\n 0.upto(ADJACENT - 1) do |factor|\n row = x + j * factor\n col = y + k * factor\n next if row < 0 || col < 0 || row >= GRID_SIZE || col >= GRID_SIZE\n product *= @grid[row][col]\n fin = factor == ADJACENT - 1\n @largest_product = product if fin && product > @largest_product\n end\n end\n end\n end\n end", "def largest_product_in_series(series, adjacency_length = 13)\n zero_ord = '0'.ord\n factors = []\n largest_product = 0\n current_product = 1\n series.each_char do |new_factor|\n # this assumes we can trust our input will only contain digits. if we can\n # safely assume this, calling string#ord and then subtracting the ordinal\n # of the string '0' will work faster than string#to_i.\n new_factor = new_factor.ord - zero_ord\n if new_factor.zero?\n # if our new_factor is zero, we know that the product of anything\n # currently in our collection of factors will be zero. so, rather than\n # work through that, just drop the current set of factors, drop the\n # zero, and reset our current product.\n factors.clear\n current_product = 1\n next\n end\n\n factors << new_factor\n current_product *= new_factor\n next if factors.length < adjacency_length\n largest_product = current_product if current_product > largest_product\n current_product /= factors.shift\n end\n largest_product\nend", "def largest_product_series(number, length)\n x = [1]\n string = number.to_s\n (string.length - length).times do |i|\n array = []\n length.times do \n array << string[i].to_i\n i += 1\n end\n if array.inject(:*) > x.inject(:*)\n x = array\n end\n end\n p x\n p x.inject(:*)\nend", "def greatest_product(int_array)\n\n # initialize arrays of greatest and lowest ints\n three_greatest_ints = [nil, nil, nil]\n two_lowest_ints = [nil, nil]\n\n # update arrays of greatest and lowest ints with each integer\n int_array.each do |int| # greatest?\n insert_number(three_greatest_ints, int, true)\n insert_number(two_lowest_ints, int, false)\n end\n\n # find the product of the three highest ints, and the product of the two lowest ints and the highest int\n positive_product = three_greatest_ints[0] * three_greatest_ints[1] * three_greatest_ints[2]\n negative_product = three_greatest_ints[0] * two_lowest_ints[0] * two_lowest_ints[1]\n\n # compare the two products and return whichever is greater\n positive_product > negative_product ? ( return positive_product ) : ( return negative_product )\nend", "def highest_product_brute(array_of_ints)\n array_size = array_of_ints.size\n return \"Input array has to contain at least 3 integers.\" if array_size < 3\n highest_three_integers = array_of_ints.sort.slice(array_size-3, 3)\n result = highest_three_integers.inject(:*)\nend", "def column_max( table, column )\n\tmax = -9999999\n\t(0...(column + 2)).each do |x|\n\t\tif table[x][column] != nil\n\t\t\tif table[x][column] > max\n\t\t\t\tmax = table[x][column]\n\t\t\tend\n\t\tend\n\tend\n\n\treturn max\nend", "def col_max() return 2 end", "def largest_dot_product( array1, array2)\n #array1 = [3, 1, 7]\n #array2 = [5, 4, 6]\n \n array1 = array1.sort\n array2 = array2.sort\n result = 0\n \n for i in 0..array1.length()-1 do\n result += array1[i] * array2[i]\n end\n return result\n end", "def max\n maximo = 0.to_f\n for i in 0...matriz.size\n if matriz[i] != nil\n matriz[i].each do |key, value|\n if matriz[i][key].to_f > maximo\n maximo = matriz[i][key].to_f\n end\n end\n end\n end\n maximo\n end", "def largest_sum_pair(array)\nend", "def highest_product(array_of_ints)\n array_size = array_of_ints.size\n return \"Input array has to contain at least 3 integers.\" if array_size < 3\n\n min_and_max = array_of_ints.slice(0, 2).minmax\n\n highest = min_and_max[1]\n lowest = min_and_max[0]\n highest_product_of_2 = highest * lowest\n lowest_product_of_2 = highest * lowest\n highest_product_of_3 = array_of_ints.slice(0, 3).inject(:*)\n\n i = 2\n\n while i < array_size\n current = array_of_ints[i]\n possible_highest = current*highest\n possible_lowest = current*lowest\n\n highest_product_of_3 = [highest_product_of_3, current*highest_product_of_2, current*lowest_product_of_2].max\n highest_product_of_2 = [highest_product_of_2, possible_highest, possible_lowest].max\n lowest_product_of_2 = [lowest_product_of_2, possible_highest, possible_lowest].min\n highest = [current, highest].max\n lowest = [current, lowest].min\n\n i += 1\n end\n\n highest_product_of_3\nend", "def largest_value\n values.max\n end", "def largest_product_in_a_grid(length)\r\n\tthe_grid = [[ 8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8], \r\n\t\t\t\t[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0], \r\n\t\t\t\t[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65], \r\n\t\t\t\t[52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91], \r\n\t\t\t\t[22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80], \r\n\t\t\t\t[24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50], \r\n\t\t\t\t[32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70], \r\n\t\t\t\t[67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21], \r\n\t\t\t\t[24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72], \r\n\t\t\t\t[21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95], \r\n\t\t\t\t[78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92], \r\n\t\t\t\t[16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57], \r\n\t\t\t\t[86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58], \r\n\t\t\t\t[19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40], \r\n\t\t\t\t[ 4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66], \r\n\t\t\t\t[88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69], \r\n\t\t\t\t[04, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36], \r\n\t\t\t\t[20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16], \r\n\t\t\t\t[20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54], \r\n\t\t\t\t[ 1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48]]\r\n\t\r\n\toy_size = the_grid.size - length\r\n\tox_size = the_grid[0].size - length\r\n#\tputs \"OX: #{ox_size}\\tOY: #{oy_size}\"\r\n\tmax = 0\r\n\r\n\tfor i in (0..oy_size)\r\n\t\tfor j in (0..ox_size)\r\n\t\t\t# Diag \\\r\n\t\t\tmulti = 1\r\n\t\t\t(0..length-1).each{ |add| multi *= the_grid[i+add][j+add] }\r\n\t\t\tmax = multi if (multi > max)\r\n\t\t\t# Diag /\r\n\t\t\tmulti = 1\r\n\t\t\t(0..length-1).each{ |add| multi *= the_grid[i+add][j+length -1 -add] }\r\n\t\t\tmax = multi if (multi > max)\r\n\t\t\t# Vertical\r\n\t\t\tmulti = 1\r\n\t\t\t(0..length-1).each{ |add| multi *= the_grid[i+add][j] }\r\n\t\t\tmax = multi if (multi > max)\r\n\t\t\t# Horizontal\r\n\t\t\tmulti = 1\r\n\t\t\t(0..length-1).each{ |add| multi *= the_grid[i][j+add] }\r\n\t\t\tmax = multi if (multi > max)\r\n\t\tend\r\n\tend\r\n\r\n\treturn max\r\nend", "def maximal_square(matrix)\n return 0 if matrix.nil? || matrix.empty?\n n = matrix.size\n m = matrix[0].size\n dp = Array.new(n) {\n Array.new(m) {\n 0\n }\n }\n \n (0...n).to_a\n .product((0...m).to_a)\n .select { |i, j| matrix[i][j] != '0' }\n .map { |i, j|\n l = j == 0 ? 0 : dp[i][j - 1]\n u = i == 0 ? 0 : dp[i - 1][j]\n ul = i == 0 && j == 0 ? 0 : dp[i - 1][j - 1]\n dp[i][j] = [l, u, ul].min + 1\n dp[i][j] * dp[i][j]\n }\n .max || 0\nend", "def max_profit(prices)\n max = 0\n min = (2**(0.size * 8 -2) -1)\n\n prices.each do |price|\n if price < min\n min = price\n else\n max = [max, price - min].max\n end\n end\n\n max\nend", "def eqp_r_max(item)\n end", "def largest_palindrome_product\n palindromes = []\n\n 999.downto(100) do |x|\n 999.downto(100).each do |y|\n if (x * y).to_s == (x * y).to_s.reverse\n palindromes << x * y\n end\n end\n end\n palindromes.max\nend", "def maximo\r\n\t\t\r\n\t\tmax = @matrix[0][0]\r\n\t\t\r\n\t\ti = 0\t\t\t\t\t\t\t\t\r\n\t\t\r\n#\t\twhile i < @fil\t\t\t\t\t\t\r\n\t\t(@fil).times do\t\t\t\r\n\t\t\tj = 0\r\n\t\t\t\r\n#\t\t\twhile j < @col\t\t\t\t\t\r\n\t\t\t(@col).times do\t\t\t\t\r\n\t\t\t\tif(@matrix[i][j] > max)\r\n\t\t\t\t\t\r\n\t\t\t\t\tmax = @matrix[i][j]\r\n\t\t\t\t\t\r\n\t\t\t\tend\r\n\t\t\t\t\r\n\t\t\t\tj += 1\r\n\t\t\t\t\r\n\t\t\tend\r\n\t\t\t\r\n\t\t\ti += 1\r\n\t\t\t\r\n\t\tend\r\n\t\t\r\n\t\t#puts \"maximo: #{max}\"\r\n\t\t\r\n\t\treturn max\r\n\t\t\r\n\tend", "def col_max() 2 end", "def largest_area(nums)\n max_area = nums[0][0] * nums[0][1]\n\n nums.each do |num_set|\n if max_area < (num_set[0] * num_set[1])\n max_area = num_set[0] * num_set[1]\n end\n end\n\n return max_area\nend", "def largest_palindrome_product\n palindromes = []\n for i in (900..999) do\n for j in (900..999) do\n palindromes << i*j if ((i*j).to_s == (i*j).to_s.reverse)\n end\n end\n palindromes.max\nend", "def max_sum_kadane(matrix)\n rows = matrix.length\n return 0 if rows < 1\n cols = matrix[0].length\n return 0 if cols < 1\n\n ans = -Float::MAX\n cols.times do |l|\n dp = Array.new(rows, 0)\n l.upto(cols - 1) do |c|\n tsum = 0\n rows.times do |r|\n tsum = 0 if tsum < 0\n tsum += matrix[r][c]\n tsum += dp[r]\n ans = [ans, tsum].max\n dp[r] += matrix[r][c]\n end\n end\n end\n\n ans\nend", "def greatest_adjacent_product\n the_number = 7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\n digits = 13\n number_array = the_number.to_s.split('')\n current_test_array = []\n greatest_product = 0\n current_iter = 0\n while current_iter < 987\n for i in 0..12 do current_test_array[i] = number_array[i + current_iter].to_i end\n # for i in 0..12\n # current_test_array[i] = number_array[i + current_iter]\n # end\n temp_product = 1\n current_test_array.each { |num| temp_product *= num }\n greatest_product = temp_product if temp_product > greatest_product\n current_iter += 1\n end\n greatest_product\nend", "def max_profit(prices)\n sum = max = 0\n (0...prices.size - 1).each do |i|\n sum = [0, sum += prices[i + 1] - prices[i]].max\n max = [max, sum].max\n end\n max\nend", "def largest_palindrome_product\n largest_palindrome = 0\n\n 999.downto(100) do |i|\n i.downto(100) do |j|\n result = i * j\n largest_palindrome = result if result > largest_palindrome && result.to_s == result.to_s.reverse\n break if result <= largest_palindrome\n end\n end\n largest_palindrome\nend", "def matrixMax(matrix)\n\n n = matrix.map do |x|\n m = {}\n m['val'] = x.max\n m['hindex'] = x.index(m['val'])\n m['findex'] = matrix.index(x)\n m\n end\n\n n.inject do |h1, h2|\n if h1['val'] > h2['val']\n h1\n else\n h2\n end\n end\n end", "def maxSum(matrix)\n\nend", "def problem_eight\n big_number = File.read('big_number.txt')\n start, stop = 0, 5\n window = big_number[start, stop]\n largest_product = 0\n while stop < big_number.length\n current_product = window.split('').take(5).map(&:to_i).reduce(&:*)\n if current_product > largest_product\n largest_product = current_product\n end\n window = big_number[start += 1, stop += 1]\n end\n\n largest_product\n end", "def maximum(column_name)\n calculate(:maximum, column_name)\n end", "def matrixMax(matrix)\n n = matrix.map do |x|\n m = {}\n m['val'] = x.max\n m['hindex'] = x.index(m['val'])\n m['findex'] = matrix.index(x)\n m\n end\n\n n.inject do |h1, h2|\n if h1['val'] > h2['val']\n h1\n else\n h2\n end\n end\n end", "def max\n\t\tmax = @m[0][0]\n\t\tfor i in 0...@fi \n\t\t\tfor k in 0...@co\n\t\t\t\tif (@m[i][k] > max) then\n\t\t\t\t\tmax=@m[i][k] \n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tmax\n\tend", "def highest_options_sum\n possibilities = possibilites_matrix\n ( highest_total, highest_possibilities ) = highest_possibility_price( possibilities )\n highest_total\n end", "def left_to_diagonal_right_approach\n largest_prod = 0\n for each_row in (0..15)\n for each_col in (0..15)\n a = $grid_of_numbers[each_row][each_col]\n b = $grid_of_numbers[each_row+1][each_col+1]\n c = $grid_of_numbers[each_row+2][each_col+2]\n d = $grid_of_numbers[each_row+3][each_col+3]\n\n curr_prod = a*b*c*d\n if curr_prod > largest_prod\n largest_prod = curr_prod\n end\n end\n end\n \n return largest_prod\nend", "def highest_price\n # CARYN SAYS:the way you describe this above is incorrect! Reread the README\n # It should be the integer price for the most expensive listing of this recipe \n Recipe.all.max { |recipe_a, recipe_b| recipe_a.average_price <=> recipe_b.average_price }\n end", "def find_max_value(array)\nx = 0 \n array.length.times { |index|\n if array[index] > x \n x = array[index]\n end\n }\n x\n end", "def problem_66\n max = [0,0]\n (2..1000).each do |d|\n top,bot = d.sqrt_frac {|t,b| (t*t - d*b*b) == 1}\n next unless top\n max = [max,[top,d]].max\n puts \"#{d} #{top} #{bot}\"\n end\n max[1]\nend", "def largest_palidrome_product(size)\n\traise \"Size must be greater that zero\" if size < 1\n\tpalindrome_product = 0;\n\tupper_limit_arry = Array.new(size, 10)\n\tlower_limit_arry = Array.new(size-1 , 10)\n\tupper_limit = upper_limit_arry.inject(:*) - 1\n\tlower_limit = lower_limit_arry.inject(:*)\n\tupper_limit.downto(lower_limit).each do | num |\n\t\tnum.downto(lower_limit).each do | x |\n\t\tpalindrome_product = x * num if is_palindrome?(x * num) && palindrome_product < x * num\n\t\tend\n\tend\n\tpalindrome_product\nend", "def least_product(num)\n m = 2\n 2.upto(num) do |n|\n m = m.lcm(n)\n end\n return m\nend", "def largest_pair(pairs_array)\n bestPair = []\n largestSum = -99999\n pairs_array.each do |element|\n if element[0] + element[1] > largestSum\n largestSum = element[0] + element[1]\n bestPair = element\n end\n end\n return bestPair\n \nend", "def find_highest_sell(sells)\n (sells.max_by{|k,v| v})\nend", "def max\n \n # Establecemos valor del primer elemento\n max = @matrix[0][0]\n i = 0\n \n #Fila a fila actualizando el valor maximo\n while (i < @fil)\n j = 0\n while (j < @col)\n if (@matrix[i][j] > max)\n max = @matrix[i][j]\n end\n j += 1\n end\n i += 1\n end\n max\n end", "def naive_algorithm(arr)\n\tproduct = 0\n\tarr.each do |i|\n\t arr.each do |j|\n\t \tp = arr[i] * arr[j]\n\t \tproduct = p if product < p\n\t end\t\n\tend\t\t\n\tproduct\nend", "def solution(a)\n \n max = 0\n # write your code in Ruby 2.2\n max if a.nil? || a.length == 0\n \n if a.length < 4\n max = 1\n a.each do |item|\n max = max * item\n end\n max\n end\n \n # order first => nlogn + left and right edge max three\n a.sort!\n \n # - - -\n # + + +\n if a[0] >= 0 || a[-1] <= 0 || a[1] >= 0\n max = a[-1] * a[-2] * a[-3]\n max\n end\n \n # n = 4\n max = a[0] * a[1] * a[2]\n max = [max,a[0] * a[1] * a[-1]].max\n max = [max,a[0] * a[-2] * a[-1]].max\n max = [max,a[-3] * a[-2] * a[-1]].max\n max\n end", "def largest_palindrome_product(n) \r\n array = []\r\n beginning = (\"1\" + (\"0\" * (n - 1))).to_i\r\n ending = (\"9\" + (\"9\" * (n - 1))).to_i\r\n x = (beginning..ending).to_a\r\n y = (beginning..ending).to_a\r\n x.each do |num1|\r\n y.each do |num2|\r\n product = num1 * num2\r\n if product.to_s == product.to_s.reverse \r\n array << product\r\n end \r\n end \r\n end \r\n array.sort.last\r\nend", "def solve(matrix)\n \n count = 0\n (0...matrix.length).each do |i1|\n largest_row_idx = matrix[i1].index(matrix[i1].max)\n unless matrix[i1].max < matrix[i1][largest_row_idx]\n count += 1\n end\n \n end\n return count \nend", "def largest_area(input_array)\n max = 0\n \n input_array.each do |item|\n area = item[0] * item[1] # 1 * 2\n if area > max\n max = area\n end\n end\n return max\n end", "def largest(array)\nend" ]
[ "0.81063545", "0.748328", "0.7462482", "0.73779976", "0.737253", "0.7218915", "0.71026534", "0.709903", "0.70870435", "0.7055352", "0.7034241", "0.70301944", "0.7026105", "0.7025688", "0.70204794", "0.7011268", "0.70048285", "0.696654", "0.6965646", "0.69614804", "0.689627", "0.68780386", "0.6837786", "0.68238866", "0.6809078", "0.680445", "0.6803112", "0.6788555", "0.67835945", "0.6773148", "0.6764489", "0.6743414", "0.667171", "0.6665833", "0.6634681", "0.6603897", "0.65802777", "0.6571788", "0.65448093", "0.65433735", "0.65224427", "0.65107787", "0.6486318", "0.64464915", "0.64442986", "0.64395666", "0.64332247", "0.6428739", "0.6385631", "0.63732845", "0.6371324", "0.6357067", "0.63538766", "0.6348366", "0.6318789", "0.6316032", "0.63053846", "0.6304478", "0.63015044", "0.62976986", "0.62966967", "0.6286205", "0.628213", "0.62734973", "0.6265301", "0.62617254", "0.6246857", "0.6231736", "0.6224146", "0.6220285", "0.6209385", "0.620424", "0.6183609", "0.6150411", "0.6136087", "0.61145604", "0.6110364", "0.60915035", "0.60914207", "0.60862964", "0.60850346", "0.6077119", "0.60752475", "0.6071664", "0.60646856", "0.60636634", "0.60625184", "0.60548013", "0.60527897", "0.60460687", "0.60423034", "0.6039021", "0.6035054", "0.6029042", "0.60244006", "0.6024244", "0.60141367", "0.60038793", "0.6003314", "0.60031927" ]
0.67000103
32
Left to right per row approach
def left_to_right_approach largest_prod_of_all_rows = 0 for each_row in (0..19) curr_largest_prod_in_row = left_to_right_helper($grid_of_numbers[each_row]) if curr_largest_prod_in_row > largest_prod_of_all_rows largest_prod_of_all_rows = curr_largest_prod_in_row end end return largest_prod_of_all_rows end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_other_rows \n left = 2\n right = @n - 1\n\n (0..t-1).each do |c|\n (1..m-1).each do |r|\n @rounds[c][r] = \"#{left}-#{right}\"\n right = right_decrement(right)\n if r < m-1\n left = left_increment(left)\n elsif r == m-1\n left = left_increment_for_the_last_column(left)\n end\n end\n end\n end", "def make_row(prev_row)\n result = [1]\n (prev_row.length).times do |idx|\n left = prev_row[idx]\n right = prev_row[idx+1]\n\n if left && right\n result << left + right\n elsif left.nil?\n result << right + 1\n elsif right.nil?\n result << left\n end\n end\n result\nend", "def fold_right(state)\n new_state = []\n state.row_vectors.each {|row|\n values = row.to_a.reverse\n values = @line_folder.fold(values)\n new_state << values.reverse\n }\n Matrix.rows(new_state)\n end", "def leftToRightWraparound(grid, width, height)\n\n strings = leftToRight(grid, width, height)\n\n for string in strings do\n\n string << string\n\n end\n\n return strings\n\nend", "def right(r, sc, ec, array, final_array) #r for row, sc start column, end column\n (sc..ec).each do |num|\n final_array << array[r][num]\n end\nend", "def fold!\n raise \"Bad input\" if width%2 == 1\n @grid = (0 .. (width / 2 - 1)).map { |col|\n @grid[col].zip(@grid[width - col - 1]).map {|pair| pair[1].reverse + pair[0]}\n }\n end", "def rightToLeft(grid, width, height)\n\n strings = leftToRight(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\nend", "def turn_left\n # a kind of matrix multiplication\n new_row_diff = 0 - @col_diff\n new_col_diff = @row_diff + 0\n @row_diff = new_row_diff\n @col_diff = new_col_diff\n end", "def turn_right\n new_row_diff = @col_diff + 0\n new_col_diff = 0 - @row_diff\n @row_diff = new_row_diff\n @col_diff = new_col_diff\n end", "def diagonal_left_right\n func = lambda do |arr, mark|\n return mark if arr.all? { |el| el == mark } end\n\n left = []; len = @grid.length\n (0...len).each { |i| left << @grid[i][i] }\n\n right = []; len = @grid.length - 1\n (0...@grid.length).each { |i| right << @grid[i][len-i] }\n\n return :X if (func.call(left, :X) == :X) || (func.call(right, :X) == :X)\n return :O if (func.call(left, :O) == :O) || (func.call(right, :O) == :O)\n end", "def part_of_row_right(starting, ending)\n row(starting[1])[(starting[0] + 1)..(ending[0] - 1)]\n end", "def flip_horizontal(matrix)\n matrix.map(&:reverse)\n end", "def rightToLeftWraparound(grid, width, height)\n\n strings = rightToLeft(grid, width, height)\n\n for string in strings do\n\n string << string\n\n end\n\n return strings\n\nend", "def left_borrows_from_mid\n @left.type, @left.value1, @value1, @left.mid = 2, @value1, @mid.value1, @mid.left\n @mid.shift_left\n @mid.type -= 1\n end", "def flip_horizontally!\n for y in 0..((height - 1) >> 1) do\n other_y = height - (y + 1)\n other_row = row(other_y)\n replace_row!(other_y, row(y))\n replace_row!(y, other_row)\n end\n self\n end", "def rotate_matrix(len, mtx)\n (0..(len / 2)).each do |layer|\n first = layer\n last = len - 1 - layer\n (first..last - 1).each do |i|\n top = mtx[first][i]\n mtx[first][i] = mtx[last - i][first] # TOP <-- LEFT\n mtx[last - i][first] = mtx[last][last - i] # LEFT <-- BOTTOM\n mtx[last][last - i] = mtx[i][last] # BOTTOM <-- RIGHT\n mtx[i][last] = top\n end\n end\n mtx\nend", "def shift_rows\n [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11].map { |i| self[i] }\n end", "def row_echelon_form\n\t\tself.row_reduce_below()\n\n\t\tfor row in 0..(@num_rows-1)\n\t\t\tfor row2 in (row+1)..(@num_rows-1)\n\t\t\t\trow2_leader_pos = @rows[row2].find_leader_pos\n\t\t\t\tif row2_leader_pos < 0\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\t\trow_leader_val = @rows[row][row2_leader_pos]\n\t\t\t\tif row_leader_val == 0\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\t\t@rows[row].bits ^= @rows[row2].bits\n\t\t\tend\n\t\tend\n\tend", "def part_of_row_left(starting, ending)\n row(starting[1])[(ending[0] + 1)..(starting[0] -1)]\n end", "def right(values) # turn left\n multiple(values).each { |degree| rotate(-degree) }\n end", "def compute_row(previous_row)\n new_row = []\n # new row is always 1 longer than previous row\n new_row_length = previous_row.length + 1\n (0...new_row_length).each do |index|\n # first and last numbers are always 1\n if index == 0 || index == new_row_length - 1\n new_row << 1\n else\n new_row << previous_row[index - 1] + previous_row[index]\n end\n end\n new_row\nend", "def right_to_left\n @buckets[0] = @buckets[0] + @buckets[1]\n @buckets[1] = if @buckets[0] > @first\n @buckets[0] - @first\n else\n @buckets[1] = 0\n end\n @buckets[0] = @first if @buckets[0] > @first\n @path.push([@buckets[0], @buckets[1]])\n end", "def rotate_row(a, b, screen)\n edge = screen[a].pop(b)\n screen[a].unshift(edge)\n screen[a].flatten!\n\n screen\nend", "def cursor_right(wrap = false)\n if col_max >= 2 && (index % col_max == col_max - 1)\n select(index + 1 - col_max)\n elsif col_max >= 2 && (index < item_max - 1 || (wrap && horizontal?))\n select((index + 1) % item_max)\n end\n end", "def rotate_matrix matrix\n\tlayer = 0\n\tfor layer in 0..(matrix.size / 2).ceil\n\t\tlast = matrix.size - 1 - layer\n\t\tfor i in layer..last-1 # not sure here \n\t\t\toffset = i - layer\n\t\t\ttop = matrix[layer][i]\n\n\t\t\tmatrix[layer][i] = matrix[last - offset ][layer] #7 4\n\n\t\t\tmatrix[last - offset][layer] = matrix[ last ][ last - offset ] #9 8\n\n\t\t\tmatrix[ last ][ last - offset] = matrix[ i ][last ] #3 6\n\n\t\t\t#top -> right\n\t\t\tputs i\n\t\t\tputs last\n\t\t\tmatrix[ i ][ last] = top\n\t\tend\n\tend\n\nend", "def rotate_right!\n new_pixels = []\n 0.upto(width - 1) { |i| new_pixels += column(i).reverse }\n replace_canvas!(height, width, new_pixels)\n end", "def make_first_row \n counter_first_half = 0\n counter_second_half = 1\n (1..t).each do |i| \n if i <= m\n if @is_odd\n @rounds[counter_first_half][0] = \"#{i}\"\n counter_first_half += 2\n else\n @rounds[counter_first_half][0] = \"#{i}-#{n}\"\n counter_first_half += 2\n end\n elsif i > @m and i != @n\n if @is_odd\n @rounds[counter_second_half][0] = \"#{i}\"\n counter_second_half += 2 \n else\n @rounds[counter_second_half][0] = \"#{n}-#{i}\"\n counter_second_half += 2\n end\n end\n end\n end", "def fold_left(state)\n new_state = []\n state.row_vectors.each_index {|i|\n values = state.row_vectors[i].to_a\n values = @line_folder.fold(values)\n new_state << values\n }\n Matrix.rows(new_state)\n end", "def row(p)\n x = p * (p - 1)\n y = x + p - 1\n x.upto(y) {|i| cell(p.odd? ? x - i + y : i) }\n end", "def row_for(p, r)\n if p <= 1\n cell(0)\n elsif p.odd?\n if r == p - 1\n row(p)\n else\n row_for(p - 1, r)\n col(p, r)\n end\n else\n if r == 0\n row(p)\n else\n col(p, r)\n row_for(p - 1, r - 1)\n end\n end\n end", "def right_borrows_from_mid\n @right.type, @right.mid, @right.value1 = 2, @right.left, @value2\n if @mid.type == 3\n @right.left, @value2 = @mid.right, @mid.value2\n else\n @right.left, @value2 = @mid.mid, @mid.value1\n end\n @mid.type -= 1\n end", "def flip_horizontal\n (0...@text_lines.size).each do |i|\n @text_lines[i].reverse!\n @sltn_lines[i].reverse!\n end\n end", "def row_reduce_below\n\t\ttop_row = 0\n\t\tleft_column = 0\n\n\t\twhile (top_row < @num_rows) && (left_column < @num_cols)\n\t\t\t# Find the nearest row with a non-zero value in this column.\n\t\t\t# Exchange that row with this one. If this is the last row, there\n\t\t\t# are no rows below to pivot into place, so don't bother.\n\t\t\tif top_row < (@num_rows - 1)\n\t\t\t\tpivot_row = top_row\n\t\t\t\tpivot_successful = false\n\t\t\t\twhile !pivot_successful && (pivot_row < @num_rows)\n\t\t\t\t\tif @rows[pivot_row][left_column] != 0\n\t\t\t\t\t\tif top_row != pivot_row\n\t\t\t\t\t\t\ttemp = @rows[top_row]\n\t\t\t\t\t\t\t@rows[top_row] = @rows[pivot_row]\n\t\t\t\t\t\t\t@rows[pivot_row] = temp\n\t\t\t\t\t\tend\n\t\t\t\t\t\tpivot_successful = 1\n\t\t\t\t\telse\n\t\t\t\t\t\tpivot_row += 1\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif !pivot_successful\n\t\t\t\t\tleft_column += 1\n\t\t\t\t\tnext # Work on the next column.\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# We can have a zero leading element in this row if it's\n\t\t\t# the last row and full of zeroes.\n\t\t\tif @rows[top_row][left_column] != 0\n\t\t\t\t# Clear this column.\n\t\t\t\tfor row in (top_row+1)..(@num_rows-1)\n\t\t\t\t\tcurrent_row_lead = @rows[row][left_column]\n\t\t\t\t\tif current_row_lead != 0\n\t\t\t\t\t\t@rows[row].bits ^= @rows[top_row].bits\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tleft_column += 1\n\t\t\ttop_row += 1\n\t\tend\n\tend", "def bottomRightToTopLeft(grid, width, height)\n\n strings = topLeftToBottomRight(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend", "def topRightToBottomLeft(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-left half of the grid, including the longest diagonal\n for x in 0..width-1 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x - y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-right half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[width - x + y - 1, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n end\n\n return strings\nend", "def drop_left\n tbl = self.class.new(\n 'Columns' => Array.new(self.rows.count+1,' '),\n 'Header' => self.header,\n 'Indent' => self.indent)\n (self.columns.count+1).times do |ti|\n row = self.rows.map {|r| r[ti]}.unshift(self.columns[ti]).flatten\n # insert our col|row break. kind of hackish\n row[1] = \"| #{row[1]}\" unless row.all? {|e| e.nil? || e.empty?}\n tbl << row\n end\n return tbl\n end", "def bottomLeftToTopRight(grid, width, height)\n\n strings = topRightToBottomLeft(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend", "def adjoiningTile(row, column, side)\n\tif( row.is_a?(Integer) && column.is_a?(Integer) && side.is_a?(Integer) )\n\t\tcase side\n\t\t\twhen 0\n\t\t\t\treturn [row - 1, column - 1]\n\t\t\twhen 1\n\t\t\t\treturn [row - 1, column]\n\t\t\twhen 2\n\t\t\t\treturn [row, column + 1]\n\t\t\twhen 3\n\t\t\t\treturn [row + 1, column]\n\t\t\twhen 4\n\t\t\t\treturn [row + 1, column - 1]\n\t\t\twhen 5\n\t\t\t\treturn [row, column - 1]\n\t\t\telse\n\t\t\t\traise \"Invalid side (\" + side.to_s + \")!\"\n\t\tend\n\telse\n\t\traise \"Expected a (row, column, side) as (int, int, int)\"\n\tend\nend", "def move_right(array)\r\n set_current_row_col(array)\r\n new_col = (@current_col == array.first.length - 1) ? 0 : @current_col + 1 # This logic will decide the new co-ordinated of space\r\n current_ele = array[@current_row][new_col]\r\n array[@current_row][new_col] = ' '\r\n replace_existing_element(array,current_ele, @current_row, @current_col)\r\n array\r\n end", "def fold_left_into_mid\n @mid.shift_right\n @mid.type, @mid.value1, @mid.left = 3, @value1, @left.left\n shift_left\n @type = 2\n end", "def rotate_column(a, b, screen)\n column = []\n screen.each { |row| column << row[a] }\n\n edge = column.pop(b)\n column.unshift(edge)\n column.flatten!\n\n screen.each_with_index do |row, i|\n row[a] = column[i]\n end\n\n screen\nend", "def mid_borrows_from_right\n @mid.type, @mid.value1, @value2, @mid.mid = 2, @value2, @right.value1, @right.left\n @right.shift_left\n @right.type = 2\n end", "def normalize row, col\n [row % @rows, col % @cols]\n end", "def reduced_row_echelon_form(ary)\n lead = 0\n rows = ary.size\n cols = ary[0].size\n rary = convert_to_rational(ary) # use rational arithmetic\n catch :done do\n rows.times do |r|\n throw :done if cols <= lead\n i = r\n while rary[i][lead] == 0\n i += 1\n if rows == i\n i = r\n lead += 1\n throw :done if cols == lead\n end\n end\n # swap rows i and r \n rary[i], rary[r] = rary[r], rary[i]\n # normalize row r\n v = rary[r][lead]\n rary[r].collect! {|x| x /= v}\n # reduce other rows\n rows.times do |i|\n next if i == r\n v = rary[i][lead]\n rary[i].each_index {|j| rary[i][j] -= v * rary[r][j]}\n end\n lead += 1\n end\n end\n rary\n end", "def right\n row, col = @position\n return [row, col + 1] unless col + 1 > 7\n []\n end", "def mid_borrows_from_left\n @mid.type, @mid.mid, @mid.value1, @mid.left = 2, @mid.left, @value1, @left.right\n @left.type, @value1 = 2, @left.value2\n end", "def cursor_left(wrap = false)\n if col_max >= 2 && (index % col_max == 0)\n select(index - 1 + col_max)\n elsif col_max >= 2 && (index > 0 || (wrap && horizontal?))\n select((index - 1 + item_max) % item_max)\n end\n end", "def mid_rows(row)\n rows = get_rows\n mid_rows = \"\"\n mid_rows = (1..@n-2).map do |x|\n \"|\" + rows[row][x].to_s.center(@max_length)\n end\n mid_rows = mid_rows.join\n end", "def right_mid\n\t\t[ cl[0], cl[1]+1 ] \n\tend", "def row_ary\n return FIRST_ROW_ARY if FIRST_PREVIOUS_ROW_ARY == @previous_row_ary\n\n starting_ary = EVERY_SIDE_ROW_ARY + @previous_row_ary + EVERY_SIDE_ROW_ARY\n # https://apidock.com/ruby/Enumerable/each_cons ...grabs 2 elements per iteration, shifting by only one-element for every iteration after the first\n return starting_ary.each_cons(2).map {|a,b| a + b }\n end", "def solve_row! r\n\t\trow = @tile_layout[r]\n\t\t(0..@size-2).each do |column|\n\t\t\ttile = row[column]\n\t\t\tbinding.pry if tile.blank?\n\n\t\t\t# assume that there is only one possible match for the next tile\n\t\t\teast_neighbor = tile.possible_east_neighbors\n\t\t\tbinding.pry unless east_neighbor.count == 1\n\t\t\teast_neighbor = east_neighbor.first\n\n\t\t\teast_neighbor.orient! :west, tile.east_edge.reverse\n\t\t\trow[column + 1] = east_neighbor.place!\n\t\tend\n\tend", "def move_right\n for i in 0...@array.size\n if (i + 1) % XSIZE == 0\n v = @array.delete_at(i)\n yield v if block_given?\n @array.insert(i - XSIZE + 1, v)\n end\n end\n end", "def spiral_iterator\n m = matrix_clone\n result = []\n actions = {\n right: lambda { m.shift },\n down: lambda { m.map { |row| row.pop }},\n left: lambda { m.pop.reverse },\n up: lambda { m.map { |row| row.shift }},\n }\n command_sequence = actions.keys.cycle\n result += actions[command_sequence.next].call until m.empty?\n result\n end", "def cal_row(n)\n f = []\n (0..n/2).each do |k|\n f << if k == 0\n 1\n else\n (@prev_row[k] + @prev_row[k-1])\n end\n end\n f.concat(f[0, (n+1)/2].reverse)\n end", "def right_justified_columns\n res = fields.map.with_index do |field, i|\n klass = String::Trait.trait_class(field) rescue nil\n justification = klass && klass.justification rescue :left\n [justification, i]\n end\n res = res.select {|justification, index| justification == :right}\n .map{|justification, index| index}\n res\n end", "def columns\n left...(left + bordered_width)\n end", "def left_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col-1, cell.row)}\n end", "def right_cell_x_at(x); (x + WIDTH - 1) / WIDTH; end", "def rotateLeft(a, l, r)\n arr = a.dup\n temp = arr[l]\n (l...r).each do |i|\n arr[i] = arr[i + 1]\n end\n arr[r] = temp\n arr\n end", "def redesign\n x = @mat[0].length\n y = @mat.size\n (1..y-2).each do |i|\n (1..x-2).each do |j|\n @mat[i][j] = \"0\"\n end\n end\n\n divide(1,x-2,1,y-2)\n end", "def fold_mid_into_right\n @right.shift_right\n @right.type, @right.value1, @right.left = 3, @value2, @mid.left\n @type, @mid, @value2, @right = 2, @right, nil, nil\n end", "def other_way(matrix)\n result = []\n (0..2).each do |column_index|\n new_row = (0..2).map {|row_index| matrix[row_index][column_index]}\n result << new_row\n end\n result\nend", "def my_transpose\n ret = []\n i=0\n while i < self.length\n j=0\n ret2 = []\n while j < self[i].length\n ret2 << self[j][i]\n j += 1\n end\n ret << ret2\n i += 1\n end\n ret\n end", "def go_to_next_row()\n turn_left()\n move()\n turn_left()\n end", "def vert_mirror(strng)\n string.split(\"\\n\").map do |piece|\n piece.reverse\n end.join(\"/n\")\nend", "def move_right\n @board.each(&:reverse!)\n action = move_left\n @board.each(&:reverse!)\n action\n end", "def right_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col+1, cell.row)}\n end", "def topLeftToBottomRight(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-right half of the grid, including the longest diagonal\n for x in 1..width do\n\n string = \"\"\n\n for y in 0..x-1 do\n\n letter = grid[[width-x + y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-left half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x-y, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n\n end\n\n return strings\n\nend", "def left_to_right_pass(template, variables)\n template.each_with_index do |row, i|\n letters = []\n row.each_with_index do |letter, j|\n if letter == '#'\n must_form_word(letters) if letters.size > 1\n letters = []\n else\n letters << variables[i,j]\n end\n end\n must_form_word(letters) if letters.size > 1\n end\n end", "def connect_cells\n @grid.each_with_index do |columns, col_i|\n columns.each_with_index do |cell, cell_i|\n cell.left = @grid[col_i-1][cell_i] if col_i != 0 \n cell.up = @grid[col_i][cell_i+1] if cell_i + 1 < columns.length\n cell.right = @grid[col_i+1][cell_i] if col_i + 1 < @grid.length\n cell.down = @grid[col_i][cell_i-1] if cell_i != 0\n cell.lu = @grid[col_i-1][cell_i+1] if col_i != 0 && cell_i + 1 < columns.length\n cell.ld = @grid[col_i-1][cell_i-1] if col_i != 0 && cell_i != 0\n cell.ru = @grid[col_i+1][cell_i+1] if col_i + 1 < @grid.length && cell_i + 1 < columns.length\n cell.rd = @grid[col_i+1][cell_i-1] if col_i + 1 < @grid.length && cell_i != 0\n end\n end\n end", "def forward_steps\n forward = forward_dir\n steps = []\n row, col = pos\n\n step1 = [row + forward, col]\n\n unless valid_pos?(step1)\n steps << step1\n\n if at_start_rows?\n step2 = [row + forward * 2, col]\n \n steps << step2 if valid_pos?(step2)\n end\n end\n\n steps\n end", "def right()\n return @left + @width\n end", "def wrap(row, col)\n case wrap_type\n when :both\n row = row % @height\n col = col % @width\n when :row\n row = row % @height\n when :col\n col = col % @width\n end\n [row, col]\n end", "def reverse_2!(array)\n left_index = 0\n right_index = -1 \n \n while left_index < array.size / 2\n array[left_index], array[right_index] = array[right_index], array[left_index]\n \n left_index += 1 \n right_index -= 1\n end\n \n array\nend", "def reversal(array)\n array = array.map{|element| element} #creates a copy of array, remove to have same object_id's\n left_index = 0\n right_index = -1\n \n while left_index < array.size / 2\n array[left_index], array[right_index] = array[right_index], array[left_index]\n left_index += 1\n right_index -=1\n end\n\n array\nend", "def triangle(rows)\n 1.upto(rows) { |num| puts \"#{\"*\" * num}\".rjust(rows)}\nend", "def shift_out_left\n size.times do |i|\n yield(bit_at_position(size - i - 1), i)\n end\n end", "def right\n rotate(1)\n end", "def aggregate_by_chunks\n forward = []\n reverse = []\n chunks.each do |chunk|\n reads=get :chunks, chunk\n forward << (get :side, :left)\n reverse << (get :side, :right)\n end\n [forward,reverse]\n end", "def printArrow(direction, columns)\n col = columns-1\n \n if direction == \"left\" then\n range_to_right = 0..col\n col-=1\n range_to_left = col.downto(0) \n else\n range_to_right = col.downto(0)\n range_to_left = 1..col \n end\n \n range_to_right.each do |i|\n spaces = \" \" * i\n puts spaces + \"*\"\n end\n range_to_left.each do |i|\n spaces = \" \" * i\n puts spaces + \"*\"\n end\n\nend", "def runAlgorithm(row)\n for column in 0..@width-1\n if @columns[column] >= 0 then\n next\n end\n\n ixDiag1 = row + column\n if @diagonals1[ixDiag1] then\n next\n end\n\n ixDiag2 = @lastRow - row + column\n if @diagonals2[ixDiag2] then\n next\n end\n\n @columns[column] = row\n @diagonals1[ixDiag1] = true\n @diagonals2[ixDiag2] = true\n\n if row == @lastRow then\n @solutions.push(@columns.dup)\n else\n runAlgorithm(row + 1)\n end\n\n @columns[column] = -1\n @diagonals1[ixDiag1] = false\n @diagonals2[ixDiag2] = false\n end\n end", "def pascal_row(row)\n ([0] + row).zip(row + [0]).collect { |a, b| a + b }\nend", "def left\n row, col = @position\n return [row, col - 1] unless col - 1 < 0\n []\n end", "def to_row(row)\n 7 - row\n end", "def row_peers(i)\n row_number = i / 9\n digits_on_positions(\n row_number * 9...(row_number + 1) * 9,\n i\n )\n end", "def by_row\r\n Enumerator.new do |yielder|\r\n indices(1) do |ind|\r\n yielder << self[true, *ind]\r\n end\r\n end\r\n end", "def rotateRight(a, l, r)\n arr = a.dup\n temp = arr[r]\n r.downto(l + 1).each do |i|\n arr[i] = arr[i - 1]\n end\n arr[l] = temp\n arr\n end", "def crossword(arr, word)\n earliest_col = -1\n ans = []\n arr.each_with_index do |row, i|\n earliest_col = solve_horiz(row, word)\n ans = [i, earliest_col]\n break\n end\n\n tarr = transpose arr\n tarr.each_with_index do |col, i|\n earliest_row = solve_horiz(row, word)\n if earliest_row <= ans[0] && i <= ans[1]\n ans = [earliest_row, i]\n end\n break\n end\n\n ans\nend", "def spiral_order(a)\n return [] if a.empty?\n res = []\n left, top = 0, 0\n bottom, right = a.length - 1, a[0].length - 1\n\n while left <= right && top <= bottom\n for i in (left..right)\n res << a[top][i]\n end\n top += 1\n for i in (top..bottom)\n res << a[i][right]\n end\n right -= 1\n if top <= bottom\n # decreament for loop\n for i in (right).downto(left)\n res << a[bottom][i] \n end\n bottom -= 1\n end\n if left <= right\n for i in (bottom).downto(top)\n res << a[i][left]\n end\n left += 1\n end\n end\n res\nend", "def trans(input)\n\trows, columns = input.count, input.first.count\n\tx, y = [], []\n\ti = j = 0\n\twhile j < columns do\n\t\twhile i <= rows - 1 do\n\t\t\tx.push(input[i][j])\n\t\t\ti += 1\n\t\tend\n\t\tj += 1 #go to next column\n\t\ti = 0 #reset the inner counter to go back to 1st array\n\tend\n\tx.each_slice(rows).each.map{|e| y.push(e)}\n\treturn y\nend", "def normalized_transpose(pad='')\n sizes = row_sizes\n min_size = sizes.min\n max_size = sizes.max\n source = if min_size != max_size # Multiple row sizes\n map{|row| row + [pad]*(max_size - row.size)}\n else\n source = self\n end\n source.transpose\n end", "def move_left(array)\r\n set_current_row_col(array)\r\n new_col = (@current_col == 0) ? array.first.length - 1 : @current_col - 1 # This logic will decide the new co-ordinated of space\r\n current_ele = array[@current_row][new_col]\r\n array[@current_row][new_col] = ' '\r\n replace_existing_element(array,current_ele, @current_row, @current_col)\r\n array\r\n end", "def rotate_matrix(matrix)\n (0...matrix.length).each do |row|\n col = row + 1\n while col < matrix.length\n matrix[row][col], matrix[col][row] = matrix[col][row], matrix[row][col]\n col += 1\n end\n end\n\n (0...matrix.length).each do |row|\n start_col = 0\n end_col = matrix.length - 1\n\n while start_col < end_col\n matrix[row][start_col], matrix[row][end_col] = matrix[row][end_col], matrix[row][start_col]\n start_col += 1\n end_col -= 1\n end\n end\n\n matrix\nend", "def diagonals\n [board.map.with_index { |row, i| row[i] },\n board.map.with_index { |row, i| row[row.size - i - 1] }]\n end", "def horizontalLines\n (0...@height).inject([]) { |arr, row| arr << @modified.row(row) }\n end", "def diagonal_left\n end", "def left_equal_right(array)\n left = 0\n right = array.reduce(:+)\n array.each do |x|\n right -= x\n if left == right\n p array.index(x)\n end\n left += x\n end\nend", "def reverse_each_row(x)\n rows = x.to_a.map(&:reverse)\n Numo::SFloat[*rows]\nend", "def move_right(mat, y, x)\n return if (x + 1) > (mat.size - 1)\n\n zero_el = mat[y][x]\n other_el = mat[y][x + 1]\n mat[y][x + 1] = zero_el\n mat[y][x] = other_el\n\n { m: mat, zero: update_coordinates(zero_el, other_el), move: :right }\nend", "def rotate_a(matrix)\n res = []\n n = matrix.size\n\n n.times do |row|\n new_row = []\n\n n.times do |col|\n new_row[col] = matrix[n - col - 1][row]\n end\n\n res[row] = new_row\n end\n\n res\nend" ]
[ "0.6874047", "0.64136726", "0.6403356", "0.63473946", "0.629021", "0.62245977", "0.615518", "0.6101817", "0.59964246", "0.5982305", "0.59396225", "0.5917513", "0.5917364", "0.5909867", "0.5868755", "0.5852535", "0.5849668", "0.5830294", "0.5803585", "0.57982105", "0.57822037", "0.5768554", "0.5761314", "0.57126987", "0.5712332", "0.57116234", "0.56972635", "0.5679083", "0.56608653", "0.5648641", "0.5645752", "0.5642646", "0.5642344", "0.56299555", "0.5568013", "0.5555187", "0.55358624", "0.5535555", "0.55329144", "0.5528494", "0.55070937", "0.5500098", "0.5499382", "0.54844403", "0.54836106", "0.5469791", "0.5462225", "0.5461943", "0.54589194", "0.5454728", "0.5453599", "0.54533553", "0.54458344", "0.5427195", "0.54256433", "0.5419205", "0.5413768", "0.5412731", "0.5411935", "0.54114807", "0.5410213", "0.5389046", "0.53876734", "0.5383882", "0.5371289", "0.53594965", "0.5357648", "0.535601", "0.5354705", "0.53364813", "0.53292924", "0.53270936", "0.53208447", "0.5319235", "0.5318772", "0.53136545", "0.53130805", "0.53050846", "0.53050756", "0.5304299", "0.53012323", "0.5293534", "0.5292965", "0.5286401", "0.5284362", "0.5284091", "0.52807045", "0.52776515", "0.52731675", "0.5271266", "0.526886", "0.52616715", "0.52586997", "0.52565503", "0.5251299", "0.524588", "0.52257323", "0.52161485", "0.5210089", "0.5208865" ]
0.57355994
23
Top to bottom per col approach
def top_to_bottom_approach largest_prod_of_all_cols = 0 for each_row in (0..15) for each_col in (0..19) curr_prod_in_col = $grid_of_numbers[each_row][each_col] * $grid_of_numbers[each_row + 1][each_col] * $grid_of_numbers[each_row + 2][each_col] * $grid_of_numbers[each_row + 3][each_col] if curr_prod_in_col > largest_prod_of_all_cols largest_prod_of_all_cols = curr_prod_in_col end end end return largest_prod_of_all_cols end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rows\n top...(top + bordered_height)\n end", "def topToBottom(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n for x in 0..width-1 do\n\n string = \"\"\n\n for y in 0..height-1 do\n letter = grid[[x, y]]\n string << letter\n end\n\n strings << string\n\n end\n\n return strings\nend", "def arrange_in_columns(cols, widths, border)\n row = \"\"\n idxs = cols.collect{|c| 0 }\n\n while cols.zip(idxs).any?{|col| col[0].length > col[1] }\n cols.each.with_index do |col, idx|\n slice_width = widths[idx]\n\n slice = col.slice(idxs[idx], slice_width) || \"\" # sacamos el pedazo de la columna\n row << slice.ljust(slice_width) # concatenamos a la fila\n idxs[idx] += slice_width # recorremos el indice\n row << \" \" * border # agregamos el border de la derecha\n end\n\n row = row.strip << \"\\n\" # quitamos el ultimo border\n end\n\n return row.strip # quitamos el ultimo salto de linea\n end", "def console_grid\n i = self.height\n grid.map do |row|\n puts row.map { |cell| \"[#{cell.value.empty? ? \"_\" : cell.value}]\" }.join(\"\") + \" #{i}\"\n i-=1\n end\n end", "def bottom\n row, col = @position\n return [row + 1, col] unless row + 1 > 7\n []\n end", "def bottomToTopWraparound(grid, width, height)\n\n strings = bottomToTop(grid, width, height)\n\n for string in strings do\n\n string << string\n\n end\n\n return strings\n\nend", "def part_of_col_up(starting, ending)\n col(starting[0])[(starting[1] + 1)..(ending[1] - 1)]\n end", "def ensure_cursor_visible\n self.top_col = index if index < top_col\n self.bottom_col = index if index > bottom_col\n end", "def ensure_cursor_visible\n self.top_col = index if index < top_col\n self.bottom_col = index if index > bottom_col\n end", "def ensure_cursor_visible\n self.top_col = index if index < top_col\n self.bottom_col = index if index > bottom_col\n end", "def topToBottomWraparound(grid, width, height)\n\n strings = topToBottom(grid, width, height)\n\n for string in strings do\n\n string << string\n\n end\n\n return strings\n\nend", "def bottomToTop(grid, width, height)\n\n strings = topToBottom(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend", "def endCol; @col + @width - 1; end", "def bottom_most_blocks\n width.times.map do |column_index|\n row_blocks_with_row_index = @blocks.each_with_index.to_a.reverse.detect do |row_blocks, row_index|\n !row_blocks[column_index].clear?\n end\n bottom_most_block = row_blocks_with_row_index[0][column_index]\n bottom_most_block_row = row_blocks_with_row_index[1]\n {\n block: bottom_most_block,\n row_index: bottom_most_block_row,\n column_index: column_index\n }\n end\n end", "def columns\n left...(left + bordered_width)\n end", "def bottom_left\n row, col = @position\n return [row + 1, col - 1] unless row + 1 > 7 || col - 1 < 0\n []\n end", "def cols\n count == 0 ? Array.new(@order) :\n first.inject([]) { |arr, item| \n arr << map { |row| row[arr.count] }; arr }\n end", "def part_of_col_down(starting, ending)\n col(starting[0])[(ending[1] + 1)..(starting[1] - 1)]\n end", "def inner_up\n # looking up at the bottom of the inner grid\n return 0 if inner.nil?\n # sum bottom edge\n (0..@size-1).map { |x| inner.get_loc(x, @size - 1) ? 1 : 0 }.sum\n end", "def arrange_tiled\n # some simplifying assumptions for constants that may need revisiting for more flexibility\n margin_v = 5\n row_height = 30\n \n rows = self.rows_of_subviews\n row_v_position = 5\n rows.each { |row|\n total_element_width = row.inject(0) {|r, view| r += view.width}\n total_margin_width = self.width - total_element_width\n margin_h = total_margin_width / (row.count + 1) # e.g. if 3 views, there are 4 margins\n \n x_tally = 0\n row.each { |view|\n view.center = CGPointMake(x_tally + margin_h + (view.width / 2), row_v_position + (row_height / 2))\n x_tally += margin_h + view.width\n }\n \n row_v_position += row_height\n }\n end", "def ensure_cursor_visible\r\n self.top_col = index if index < top_col\r\n self.bottom_col = index if index > bottom_col\r\n end", "def get_columns\n column_lines = []\n 0.upto(@@width - 1) do |column|\n column_line = \"\"\n 0.upto(@@height - 1) do |row|\n column_line << @board[row][column]\n end\n column_lines << column_line\n end\n column_lines\n end", "def display_board\n col_separator = ' | '\n row_separator = '--+---+--'\n\n @rows.each_with_index do |row, row_number|\n row.each_with_index do |col, col_number|\n print col.to_s\n print col_separator unless col_number + 1 >= row.length\n end\n puts ''\n puts row_separator unless row_number + 1 >= @rows.length\n end\n end", "def topLeftToBottomRight(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-right half of the grid, including the longest diagonal\n for x in 1..width do\n\n string = \"\"\n\n for y in 0..x-1 do\n\n letter = grid[[width-x + y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-left half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x-y, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n\n end\n\n return strings\n\nend", "def grid\n rows = []\n (1..self.height).to_a.each do |h|\n rows << row(h)\n end\n rows.reverse\n end", "def bottom_right\n row, col = @position\n return [row + 1, col + 1] unless row + 1 > 7 || col + 1 > 7\n []\n end", "def col_down\n slice_by_rows\n transpose\n self\n end", "def print_in_cols a, noc=nil\n unless noc\n noc = 3\n if a.size < 7\n noc = 1\n elsif a.size < 15\n noc = 2\n end\n end\n\n x = noc - 1\n cols = a.each_slice((a.size+x)/noc).to_a\n # todo width should be determined based on COLS of screen, and width of data\n cols.first.zip( *cols[1..-1] ).each{|row| puts row.map{|e| e ? '%-30s' % e : ' '}.join(\" \") }\nend", "def topRightToBottomLeft(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-left half of the grid, including the longest diagonal\n for x in 0..width-1 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x - y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-right half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[width - x + y - 1, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n end\n\n return strings\nend", "def connect_cells\n @grid.each_with_index do |columns, col_i|\n columns.each_with_index do |cell, cell_i|\n cell.left = @grid[col_i-1][cell_i] if col_i != 0 \n cell.up = @grid[col_i][cell_i+1] if cell_i + 1 < columns.length\n cell.right = @grid[col_i+1][cell_i] if col_i + 1 < @grid.length\n cell.down = @grid[col_i][cell_i-1] if cell_i != 0\n cell.lu = @grid[col_i-1][cell_i+1] if col_i != 0 && cell_i + 1 < columns.length\n cell.ld = @grid[col_i-1][cell_i-1] if col_i != 0 && cell_i != 0\n cell.ru = @grid[col_i+1][cell_i+1] if col_i + 1 < @grid.length && cell_i + 1 < columns.length\n cell.rd = @grid[col_i+1][cell_i-1] if col_i + 1 < @grid.length && cell_i != 0\n end\n end\n end", "def top_right\n row, col = @position\n return [row - 1, col + 1] unless row - 1 < 0 || col + 1 > 7\n []\n end", "def col\n horizontals_push; alignments_reset ; widths_reset\n end", "def traverse_top_right_to_bottom\n num_row = @twod_arr.length\n num_col = @twod_arr[0].length\n top = 0\n bottom = num_row -1\n left = 0\n right = num_col -1\n dir = 0\n\n while top <= bottom && left <= right\n if dir == 0\n for i in top..bottom\n @result << @twod_arr[i][right]\n end\n right -= 1\n dir = 1\n elsif dir == 1\n for i in right.downto(left)\n @result << @twod_arr[bottom][i]\n end\n bottom -= 1\n dir = 2\n elsif dir == 2\n for i in bottom.downto(top)\n @result << @twod_arr[i][left]\n end\n left += 1\n dir = 3\n else\n for i in left..right\n @result << @twod_arr[top][i]\n end\n top += 1\n dir = 0\n end\n end\n @result\n end", "def col(p, r)\n x = p * (p - 1)\n r = p - r - 1 if p.odd?\n cell(x - r)\n end", "def bottom_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col, cell.row+1)}\n end", "def bottomleft; return self[0], self.bottom; end", "def top\n row, col = @position\n return [row - 1, col] unless row - 1 < 0\n []\n end", "def rows\n cells_ordered = cells.order(:y => :desc)\n (0..height).map { |row_id| cells.where(y: row_id) }\n end", "def right_top\n\t\t[ cl[0]-1, cl[1]+1 ]\n\tend", "def bottomright; return self.right, self.bottom; end", "def show_the_board(board)\n cur_row = 0\n board.each do |cur_line|\n (0..2).each do |i|\n # Compose our to_print_row with the correct curent case row, a vertical separator,\n # next case same row, a vertical separator and the last case same row\n puts \"#{cur_line[0][i]}|#{cur_line[1][i]}|#{cur_line[2][i]}\"\n end\n # And each 3 lines (height of our cases) prints the horizontal separator except the third one\n cur_row < 2 ? (puts \"---------|---------|---------\") : nil\n cur_row += 1\n end\n end", "def bottom_cell_y_at(y); (y + HEIGHT - 1) / HEIGHT; end", "def print_board\n col_numbers = [' ']\n (1..8).each do |row|\n row_items = []\n\n col_numbers << ' ' + row.to_s + ' '\n row_items << row\n \n (1..8).each do |col|\n row_items << @board[[row,col]].console_rep\n end\n\n puts row_items.join(' ')\n end\n puts col_numbers.join(' ')\n end", "def row_reduce_below\n\t\ttop_row = 0\n\t\tleft_column = 0\n\n\t\twhile (top_row < @num_rows) && (left_column < @num_cols)\n\t\t\t# Find the nearest row with a non-zero value in this column.\n\t\t\t# Exchange that row with this one. If this is the last row, there\n\t\t\t# are no rows below to pivot into place, so don't bother.\n\t\t\tif top_row < (@num_rows - 1)\n\t\t\t\tpivot_row = top_row\n\t\t\t\tpivot_successful = false\n\t\t\t\twhile !pivot_successful && (pivot_row < @num_rows)\n\t\t\t\t\tif @rows[pivot_row][left_column] != 0\n\t\t\t\t\t\tif top_row != pivot_row\n\t\t\t\t\t\t\ttemp = @rows[top_row]\n\t\t\t\t\t\t\t@rows[top_row] = @rows[pivot_row]\n\t\t\t\t\t\t\t@rows[pivot_row] = temp\n\t\t\t\t\t\tend\n\t\t\t\t\t\tpivot_successful = 1\n\t\t\t\t\telse\n\t\t\t\t\t\tpivot_row += 1\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif !pivot_successful\n\t\t\t\t\tleft_column += 1\n\t\t\t\t\tnext # Work on the next column.\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# We can have a zero leading element in this row if it's\n\t\t\t# the last row and full of zeroes.\n\t\t\tif @rows[top_row][left_column] != 0\n\t\t\t\t# Clear this column.\n\t\t\t\tfor row in (top_row+1)..(@num_rows-1)\n\t\t\t\t\tcurrent_row_lead = @rows[row][left_column]\n\t\t\t\t\tif current_row_lead != 0\n\t\t\t\t\t\t@rows[row].bits ^= @rows[top_row].bits\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tleft_column += 1\n\t\t\ttop_row += 1\n\t\tend\n\tend", "def bottom(column)\n @grid[column].index([])\n end", "def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend", "def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend", "def column_next dir=0\n if dir == 0\n $stact += $grows\n $stact = 0 if $stact >= $viewport.size\n else\n $stact -= $grows\n $stact = 0 if $stact < 0\n end\nend", "def col_arrays\n #puts self.inspect\n cols = []\n (MIN_ROW_POSITION..MAX_ROW_POSITION).each do |i|\n cols[i] = []\n (MIN_COL_POSITION..MAX_COL_POSITION).each do |j|\n cols[i].push(@board[j][i])\n end\n end \n cols\n end", "def top_cell_y_at(y); y / HEIGHT; end", "def printGrid(boardGame)\n (0..boardGame.length - 1).each do |i|\n (0..boardGame[i].length - 1).each do |j|\n print \" \".colorize(:background => boardGame[i][j])\n if boardGame[i].length - 1 == j then\n puts\n end\n end \n end\nend", "def c_bottomleft\n print cursor.column(0)\n print cursor.row(height)\n end", "def cols\n # remove the nils\n cols = (Array.new(@size) { Array.new(@size) }).map { |col| col.select { |el| el != nil} }\n \n @rows.each do |row|\n row.each_with_index do |mark, col_idx|\n cols[col_idx] << mark\n end\n end\n \n cols\n end", "def data()\n self.cols.map do |col|\n back_edge = \"\"; front_edge = \"\"\n self.boards.select{|b| b.y == col}.sort_by{ |b| b.x }.each do |b|\n self.maxvalue = b.value # if b.value > self.maxvalue\n back_edge += gnuplot_row((b.y - 1), b.x, b.value)\n front_edge += gnuplot_row(b.y, b.x, b.value)\n end\n back_edge + \"\\n\" + front_edge\n end.join(\"\\n\")\n end", "def draw_grid\n print_cap\n (0...@vertical).each do |vert_index|\n (0..@v_size).each do |block_height|\n (0...@horizontal).each do |horizontal_index|\n if block_height == (@v_size/2)\n print \"|\" + \" \"*(@h_size/2)\n \"#{print @contents[horizontal_index][vert_index]}|\"\n print \" \"*(@h_size/2-1)\n else\n print \"|\"; print \" \"*@h_size\n end\n end\n print \"|\\n\" \n \n end\n print_cap\n end\n end", "def top_cell(cell)\n get_next_cell(cell) { | cell | Coordinates.new(cell.col, cell.row-1)}\n end", "def build_grid\n header = [\" \", \" a \", \" b \", \" c \", \" d \", \" e \", \" f \", \" g \", \" h \"]\n grid_display = @board.grid.map.with_index do |row, index|\n [8 - index] + build_row(row, index)\n end\n grid_display.unshift(header)\n end", "def _calculate_column_offsets\n total = 0\n coffsets = []\n ctr = 0\n ## ix will have gaps in between for hidden fields\n each_column { | c, ix|\n v = c.width\n coffsets[ctr] = total\n ctr += 1\n total += v + 2 ## blank space plus separator\n }\n return coffsets\n end", "def bottomRightToTopLeft(grid, width, height)\n\n strings = topLeftToBottomRight(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend", "def col; end", "def spans_all_cols?(cells_list)\n cells_list.inject([]) {|cols, (c, _)| cols << c }.uniq.size == @board[0].size\n end", "def topcell \n return @layout.cell( @topcell )\n end", "def each_cell(rect)\n (rect.top_left.left..rect.top_right.left).each do |left|\n (rect.top_left.top..rect.bottom_left.top).each do |top|\n yield left, top\n end\n end\nend", "def col_targets(column)\n row = 0\n until row == 8\n @targets << [row, column]\n row += 1\n end\n end", "def create_grid\n grid = Array.new(8) { Array.new(8) { [] } }\n grid.map! do |row|\n if grid.index(row).even?\n row.each { |space| row.index(space).even? ? space << 'white' : space << 'black' }\n else\n row.each { |space| row.index(space).even? ? space << 'black' : space << 'white' }\n end\n row.map! do |space|\n space << [grid.index(row), row.index(space)]\n end\n end\n grid.reverse\n end", "def print_grid\n self.print_head\n puts $line_break\n i = 0\n grid.each do |row|\n printable_row = []\n row.each do |cell|\n printable_row << cell[:display]\n end\n row_string = printable_row.join(\" | \")\n puts \"## #{$abc[i].upcase} #{row_string} ##\"\n # puts \"## #{row_string} ##\"\n puts \"##\" + \"------\" + \"+----\" * 9 + \"##\"\n i += 1\n end\n bottom_row = []\n l = 0\n 10.times do\n bottom_row << \" #{l} \"\n l += 1\n end\n print_row = bottom_row.join(\"|\")\n puts \"## #{print_row}##\"\n puts $line_break\n end", "def cell_columns\n cells = []\n # for each column\n 1.upto(3).each do |column|\n grid = []\n\n # for each row\n 1.upto(3).each do |row|\n grid << get_cell_value(row, column)\n end\n\n cells << grid\n end\n\n cells\n end", "def col_elems(y)\n col = []\n @grid.each do |sub|\n yield sub[y] if block_given?\n col.push(sub[y]) unless block_given?\n end\n col unless block_given?\n end", "def vertical_win(color)\n 7.times do |column|\n current_column = [0,7,14,21,28,35].collect{|num| @board[column+num]}\n current_column = current_column.drop_while{|rect| rect.style[:fill] != color}\n current_column = current_column.take_while{|rect| rect.style[:fill] == color}\n if current_column.count >= 4\n return true\n end\n end\n false\n end", "def view_board\n\t\t(1..8).to_a.reverse.each do |row|\n\t\t\tstr = \"\"\n\t\t\t('a'..'h').each do |col|\n\t\t\t\tif board[[row,col]] == 2\n\t\t\t\t\tstr << \" . \"\n\t\t\t\telse\n\t\t\t\t\tstr << \" #{board[[row, col]].to_s} \"\t\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tputs str\n\t\tend\n\tend", "def delta_right_top\n\t\tif cl[0] > 1 \n\t\t\t[right_top, @map.grid[cl] - @map.grid[ right_top ]]\n\t\telse\n\t\t\t# give a very large number that will never be chosen\n\t\t\t[right_top, 99999999999]\n\t\tend\n\tend", "def bottomLeftToTopRight(grid, width, height)\n\n strings = topRightToBottomLeft(grid, width, height)\n\n for string in strings do\n string.reverse!\n end\n\n return strings\n\nend", "def adjust_values\n @cols = @rows.transpose\n @blks[0] = [@rows[0][0], @rows[0][1], @rows[0][2], @rows[1][0], @rows[1][1], @rows[1][2], @rows[2][0], @rows[2][1], @rows[2][2]] #1\n @blks[1] = [@rows[0][3], @rows[0][4], @rows[0][5], @rows[1][3], @rows[1][4], @rows[1][5], @rows[2][3], @rows[2][4], @rows[2][5]] #2\n @blks[2] = [@rows[0][6], @rows[0][7], @rows[0][8], @rows[1][6], @rows[1][7], @rows[1][8], @rows[2][6], @rows[2][7], @rows[2][8]] #3\n @blks[3] = [@rows[3][0], @rows[3][1], @rows[3][2], @rows[4][0], @rows[4][1], @rows[4][2], @rows[5][0], @rows[5][1], @rows[5][2]] #4 \n @blks[4] = [@rows[3][3], @rows[3][4], @rows[3][5], @rows[4][3], @rows[4][4], @rows[4][5], @rows[5][3], @rows[5][4], @rows[5][5]] #5\n @blks[5] = [@rows[3][6], @rows[3][7], @rows[3][8], @rows[4][6], @rows[4][7], @rows[4][8], @rows[5][6], @rows[5][7], @rows[5][8]] #6\n @blks[6] = [@rows[6][0], @rows[6][1], @rows[6][2], @rows[7][0], @rows[7][1], @rows[7][2], @rows[8][0], @rows[8][1], @rows[8][2]] #7\n @blks[7] = [@rows[6][3], @rows[6][4], @rows[6][5], @rows[7][3], @rows[7][4], @rows[7][5], @rows[8][3], @rows[8][4], @rows[8][5]] #8\n @blks[8] = [@rows[6][6], @rows[6][7], @rows[6][8], @rows[7][6], @rows[7][7], @rows[7][8], @rows[8][6], @rows[8][7], @rows[8][8]] #9 \n solved\n end", "def columnate ary, sz\n buff=Array.new\n return buff if ary.nil? || ary.size == 0\n \n # determine width based on number of files to show\n # if less than sz then 1 col and full width\n #\n wid = 30\n ars = ary.size\n ars = [$pagesize, ary.size].min\n d = 0\n if ars <= sz\n wid = $gcols - d\n else\n tmp = (ars * 1.000/ sz).ceil\n wid = $gcols / tmp - d\n end\n #elsif ars < sz * 2\n #wid = $gcols/2 - d\n #elsif ars < sz * 3\n #wid = $gcols/3 - d\n #else\n #wid = $gcols/$gviscols - d\n #end\n\n # ix refers to the index in the complete file list, wherease we only show 60 at a time\n ix=0\n while true\n ## ctr refers to the index in the column\n ctr=0\n while ctr < sz\n\n f = ary[ix]\n fsz = f.size\n if fsz > wid\n f = f[0, wid-2]+\"$ \"\n ## we do the coloring after trunc so ANSI escpe seq does not get get\n if ix + $sta == $cursor\n f = \"#{CURSOR_COLOR}#{f}#{CLEAR}\"\n end\n else\n ## we do the coloring before padding so the entire line does not get padded, only file name\n if ix + $sta == $cursor\n f = \"#{CURSOR_COLOR}#{f}#{CLEAR}\"\n end\n #f = f.ljust(wid)\n f << \" \" * (wid-fsz)\n end\n\n if buff[ctr]\n buff[ctr] += f\n else\n buff[ctr] = f\n end\n\n ctr+=1\n ix+=1\n break if ix >= ary.size\n end\n break if ix >= ary.size\n end\n return buff\nend", "def columnate ary, sz\n buff=Array.new\n return buff if ary.nil? || ary.size == 0\n \n # determine width based on number of files to show\n # if less than sz then 1 col and full width\n #\n wid = 30\n ars = ary.size\n ars = [$pagesize, ary.size].min\n d = 0\n if ars <= sz\n wid = $gcols - d\n else\n tmp = (ars * 1.000/ sz).ceil\n wid = $gcols / tmp - d\n end\n #elsif ars < sz * 2\n #wid = $gcols/2 - d\n #elsif ars < sz * 3\n #wid = $gcols/3 - d\n #else\n #wid = $gcols/$gviscols - d\n #end\n\n # ix refers to the index in the complete file list, wherease we only show 60 at a time\n ix=0\n while true\n ## ctr refers to the index in the column\n ctr=0\n while ctr < sz\n\n f = ary[ix]\n fsz = f.size\n if fsz > wid\n f = f[0, wid-2]+\"$ \"\n ## we do the coloring after trunc so ANSI escpe seq does not get get\n if ix + $sta == $cursor\n f = \"#{CURSOR_COLOR}#{f}#{CLEAR}\"\n end\n else\n ## we do the coloring before padding so the entire line does not get padded, only file name\n if ix + $sta == $cursor\n f = \"#{CURSOR_COLOR}#{f}#{CLEAR}\"\n end\n #f = f.ljust(wid)\n f << \" \" * (wid-fsz)\n end\n\n if buff[ctr]\n buff[ctr] += f\n else\n buff[ctr] = f\n end\n\n ctr+=1\n ix+=1\n break if ix >= ary.size\n end\n break if ix >= ary.size\n end\n return buff\nend", "def calculate_columns!\n\n\n\n span_count = columns_span_count\n\n\n\n columns_count = children.size\n\n\n\n\n\n\n\n all_margins_width = margin_size * (span_count - 1)\n\n\n\n column_width = (100.00 - all_margins_width) / span_count\n\n\n\n\n\n\n\n columns.each_with_index do |column, i|\n\n\n\n is_last_column = i == (columns_count - 1)\n\n\n\n column.set_column_styles(column_width, margin_size, is_last_column)\n\n\n\n end\n\n\n\n end", "def display_board\n # Reverse it to display the board correctly\n reverse = @board.reverse\n \n puts \"------------------------------\"\n reverse.each do |row|\n print \"|\"\n row.each do |col|\n print \" #{col} |\" if(col != -1)\n print \" |\" if(col == -1)\n end\n puts \"\\n------------------------------\"\n end\n end", "def get_cols_index(col)\n i = @cols.size - 1\n\n @cols.reverse_each do |column|\n if col >= (Integer(column[:attributes][:min])-1)\n if col <= (Integer(column[:attributes][:max])-1)\n break\n end\n end\n i -= 1\n end\n if i < 0\n i = @cols.size #effectively nil\n end\n i\n end", "def display_board(board)\n (0..board.length - 1).each do |i|\n (0..board[i].length - 1).each do |j|\n print \" \".colorize(:background => board[i][j])\n end\n puts\n end\nend", "def get_col_contents(col)\n column_string = \"\"\n\n (0..8).each do |row|\n column_string << @board.slice(row * 9 + col,1)\n end\n\n column_string\n end", "def outer_top\n return 0 if outer.nil?\n # check bottom middle\n outer.get_loc(@center, @center - 1) ? 1 : 0\n end", "def make_other_rows \n left = 2\n right = @n - 1\n\n (0..t-1).each do |c|\n (1..m-1).each do |r|\n @rounds[c][r] = \"#{left}-#{right}\"\n right = right_decrement(right)\n if r < m-1\n left = left_increment(left)\n elsif r == m-1\n left = left_increment_for_the_last_column(left)\n end\n end\n end\n end", "def adj(heightmap, row, col)\n [[0, -1], [-1, 0], [1, 0], [0, 1]].reduce([]) do |acc, offset|\n x_offset, y_offset = offset\n x = row + x_offset\n y = col + y_offset\n\n if x < 0 || x >= heightmap.width ||\n y < 0 || y >= heightmap.height\n acc\n else\n acc.push(heightmap[x][y])\n end\n end\nend", "def get_col_cells col\n\t\treturn (col...9 ** 2).step(9).to_a\n\tend", "def find_bottom_path(cell)\n find_path(cell) { | cell | bottom_cell(cell) }\n end", "def display_board(board)\n line = ''\n 0.upto(board.length - 1) do |lane|\n 0.upto(5) do |row|\n line += fig('pad')\n 0.upto(board[lane].length - 1) do |col|\n line += board[lane][col][row]\n line += fig('vbar') unless col == 2\n line += \"\\n\" unless col < 2\n end\n line += (fig('pad') + fig('hbar')) if row == 5 && lane < 2\n end\n end\n print line\n end", "def print_board\n 6.times do |y|\n y = 5 - y # To print from top to bottom\n 7.times do |x|\n if @board[[x, y]] == nil\n x == 6 ? (puts \"( )\") : (print \"( )\")\n else\n # Prints only the 3 first letters of each color to keep board alignment\n x == 6 ? (puts \"(#{@board[[x, y]].color[0, 3]})\") : (print \"(#{@board[[x, y]].color[0, 3]})\")\n end\n end\n end\n end", "def col_positions(pos, cols)\n if pos.nil? || pos.empty?\n pos = []\n cols.each { |c| pos << Array.new(c.size) { |c| c } }\n pos\n else\n pos.split(';').collect { |p| p.split(',').collect { |p| p.to_i } }\n end\n end", "def header_footer(width, col_1, col_2)\n print col_1.to_s + leader(width, \" \", col_1.to_s, col_2.to_s) + col_2.to_s + \"\\n\"\nend", "def verticalLines\n (0...@width).inject([]) { |arr, column| arr << @modified.column(column) }\n end", "def covered_cols_at(indications, t_row)\n covered_cols = []\n indications.each do |indication|\n s = indication.sensor\n b = indication.beacon\n dist = (s.row - b.row).abs + (s.col - b.col).abs\n start_range = (s.row - t_row).abs + s.col - dist\n end_range = dist - (s.row - t_row).abs + s.col\n for t_col in start_range..end_range do\n covered_cols.push(t_col) unless b.row == t_row and b.col == t_col\n end\n end\n\n covered_cols.uniq.length\nend", "def cols\n cols = [[], [], []]\n @rows.each do |row| # row = conents of [0][0], [0][1], [0][2]\n row.each_with_index do |mark, col| #:x, 0 ; :o, 1, :x, 0\n #ex: [[:x, :o, :x], [:x, nil, :o], [:x, nil, :x]]\n cols[col] << mark #cols[0] = the three marks in column 0\n end\n end\n\n cols\n end", "def group_cols(col)\n normalize_boundaries\n cols = []\n (0..boundaries.size - 1).each do |k|\n range = group_row_range(k)\n tab_col = column(col)\n gitems = tab_col.items[range]\n cols << Column.new(header: col, items: gitems,\n type: tab_col.type, tolerant: tab_col.tolerant?)\n end\n cols\n end", "def fold!\n raise \"Bad input\" if width%2 == 1\n @grid = (0 .. (width / 2 - 1)).map { |col|\n @grid[col].zip(@grid[width - col - 1]).map {|pair| pair[1].reverse + pair[0]}\n }\n end", "def columns\n cols = []\n (0...size).each do |i|\n vals = []\n (0...size).each do |j|\n vals.push(get_square({:column => i, :row => j}))\n end\n cols.push(Row.new(size, {:vals => vals}))\n end\n cols\n end", "def next_tab\n @tab_stops.sort.each do |stop|\n if @col < stop\n return stop\n end\n end\n\n return @cols\n end", "def bottom()\n return @top + @height\n end", "def my_display(grid)\n grid.map {|x| \"#{x}\\n\"}\n #grid.transpose.map {|x| \"#{x}\\n\"}\n #grid.map {|x| \"#{x.reverse}\\n\"}\nend", "def column_for_position(position); end", "def column_for_position(position); end" ]
[ "0.64538753", "0.6239998", "0.61013013", "0.60231555", "0.6017565", "0.5979388", "0.5934234", "0.59333867", "0.59333867", "0.59333867", "0.59027475", "0.5900925", "0.5897193", "0.58860314", "0.5856215", "0.58514017", "0.58369446", "0.5831316", "0.58283556", "0.58254564", "0.57831293", "0.5782161", "0.5758097", "0.5742322", "0.57228225", "0.57187873", "0.57038236", "0.5681903", "0.5681746", "0.5670025", "0.56668156", "0.5661388", "0.5649463", "0.56424844", "0.56397045", "0.5639186", "0.56302583", "0.5627751", "0.5625618", "0.55814373", "0.55581635", "0.5555335", "0.5549739", "0.55417305", "0.55411375", "0.55072534", "0.55072534", "0.55072534", "0.5501676", "0.5493135", "0.54811484", "0.5479086", "0.54703516", "0.5451425", "0.5422852", "0.541938", "0.54125565", "0.5399494", "0.53984016", "0.5389254", "0.5381632", "0.53813076", "0.5377127", "0.5373522", "0.53655785", "0.53620464", "0.5338328", "0.53222716", "0.53200984", "0.53122", "0.53067607", "0.5301161", "0.52897483", "0.52646846", "0.52646846", "0.52612954", "0.5260406", "0.5250915", "0.5244522", "0.523398", "0.52316856", "0.52297705", "0.5229586", "0.5228265", "0.5223821", "0.5198741", "0.51968616", "0.519672", "0.51945823", "0.51927483", "0.51905435", "0.5188769", "0.51885444", "0.5187764", "0.51727927", "0.5169748", "0.5167274", "0.5165631", "0.51649296", "0.51649296" ]
0.64596754
0
Diagonal Top left to bottom right approach
def left_to_diagonal_right_approach largest_prod = 0 for each_row in (0..15) for each_col in (0..15) a = $grid_of_numbers[each_row][each_col] b = $grid_of_numbers[each_row+1][each_col+1] c = $grid_of_numbers[each_row+2][each_col+2] d = $grid_of_numbers[each_row+3][each_col+3] curr_prod = a*b*c*d if curr_prod > largest_prod largest_prod = curr_prod end end end return largest_prod end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diagonal_left\n end", "def diagonals\n down_diag = []\n up_diag = []\n \n # push sets of coordinates that make up both diagonals\n 0.upto(@size - 1) do |idx|\n down_diag << [idx, idx]\n up_diag << [idx, @size - 1 - idx]\n end\n\n [down_diag, up_diag].map do |diag|\n diag.map { |pos| self[pos] }\n end\n end", "def diagonalize floor = 0\n raise 'err: not 2d' unless self[0].class == Array\n size = self.length + self[0].length - 1\n array = Array.new(size) {Array.new}\n # acquire top and main diagonal\n self.length.times do |row|\n (0 .. row).each do |col|\n array[row] << self[row-col][col]\n end\n end\n # now cover the additional bottom diagonals\n sides_difference = self.length[0] - self.length\n if sides_difference == 0\n (1 .. self.length - 1).reverse_each do |row|\n offset_value = 0\n temp_arr = []\n while row + offset_value < self.length\n temp_arr << self[self.length - 1 - offset_value][row + offset_value]\n offset_value += 1\n end\n array[self.length - 1 + row] = temp_arr\n end\n else\n (1 .. self[0].length - 1).reverse_each do |row|\n offset_value = 0\n temp_arr = []\n while row + offset_value < self[0].length\n temp_arr << self[self.length - 1 - offset_value][row + offset_value]\n offset_value += 1\n end\n array[self[0].length - 2 + row] = temp_arr\n end\n end\n\n # phew... now to trim and format\n unless floor == 0\n index = 0\n while index < size\n if array[index].length < floor\n array.slice! index\n size -= 1\n index -= 1\n end\n index += 1\n end\n end\n\n (0..size-1).each do |index|\n while array[index].length < self.length\n array[index] << nil\n end\n end\n array\n end", "def diagonals\n vals = [[], []]\n (0...size).each do |i|\n vals[0].push(get_square({:column => i, :row => i}))\n vals[1].push(get_square({:column => i, :row => size - i - 1}))\n end\n vals.map {|v| Row.new(size, {:vals => v}) }\n end", "def rDiagonalLines\n Pxlsrt::Lines.getDiagonals(horizontalLines.reverse.flatten(1).reverse, @width, @height)\n end", "def diagonal_slide(row, col) # oh cool try the .downto here instead of the reverse always nice to try new things even though it doesn't make for the most sensical code as per https://stackoverflow.com/questions/2070574/is-there-a-reason-that-we-cannot-iterate-on-reverse-range-in-ruby love it the last time you did reverse just because you didn't think about it until later now knowing this you can do it this way love it ah nevermind no need but would have been great to write smaller.downto(0).map oh well lol remember that for some other time love Ruby what a great language\n (row <= col) ? (smaller, larger = row, col) : (smaller, larger = col, row) # establish which number is the smaller of the two and the larger love it you have some crazy short code lol. For the nw and se diagonals\n nw = check_blocking_pieces((1..smaller).map { |offset| [row-offset, col-offset] }) # go by smaller because that's which one will hit 0 first\n ne = check_blocking_pieces((1..(7-row)).map { |offset| [row+offset, col-offset] if ((col-offset) >= 0) }.compact) # Need to use .compact to remove all the nil elements that were returned by .map since can't quite use select or reject since you *do* want to return the evaluation of the array but ah well code smells http://ruby-doc.org/core-1.9.3/Array.html#method-i-compact if you don't get rid of these nils then in the check_blocking_pieces() you'll run into an error since it'll be trying to get an index of a nil value in moves lol amaizng that even the most misleading errors you can debug with debugger and a good eye fuck byebug is so powerful # go by larger but check that the thing doesn't go out of bounds, the only bounds that it could go out if you have the row correct is col-offset being less than 0 # ahh these return nil for everything it doesn't return for so that's the error love it great catch # don't know what you would do without byebug it's literally god mode\n sw = check_blocking_pieces((1..(7-col)).map { |offset| [row-offset, col+offset] if ((row-offset) >= 0) }.compact) # go up until col == 7 as long as row is above or equal to 0, could do it the other way too, as long as col <= 7 go until row hits 0, but same thing\n se = check_blocking_pieces((1..(7-larger)).map { |offset| [row+offset, col+offset] }) # increase up until the largest one equals 7 basically there might be some nil issues with this but this should work can't wait to check it if you add them all up and there are some nils they might not add let's see, ah nope thankfully map returns an empty array fucking love it Ruby is the best\n (nw + ne + sw + se)\nend", "def main_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][i] }\n end", "def diagonals\n [board.map.with_index { |row, i| row[i] },\n board.map.with_index { |row, i| row[row.size - i - 1] }]\n end", "def diagonals\n down_diag = [[0, 0], [1, 1], [2, 2]]\n up_diag = [[0, 2], [1, 1], [2, 0]]\n \n [down_diag, up_diag].map do |diag|\n diag.map { |row, col| @rows[row][col] }\n end\n end", "def minor_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][-i - 1] }\n end", "def diagonal_coords\n data_hsh = { forward: [], backward: [] }\n @width.times do |t|\n data_hsh[:forward].push([t + 1, t + 1])\n data_hsh[:backward].push([@width - t, t + 1])\n end\n data_hsh\n end", "def make_diagonal\n each{|x,y,val| set x,x,x+1 if x==y}\n self\n end", "def diagonal_left_right\n func = lambda do |arr, mark|\n return mark if arr.all? { |el| el == mark } end\n\n left = []; len = @grid.length\n (0...len).each { |i| left << @grid[i][i] }\n\n right = []; len = @grid.length - 1\n (0...@grid.length).each { |i| right << @grid[i][len-i] }\n\n return :X if (func.call(left, :X) == :X) || (func.call(right, :X) == :X)\n return :O if (func.call(left, :O) == :O) || (func.call(right, :O) == :O)\n end", "def part_of_diag_l_down(starting, ending)\n result = []\n x = starting[0] + 1\n y = starting[1] - 1\n while x < ending[0] && y > ending[1]\n result << @boxes[x][y]\n x += 1\n y -= 1\n end\n result\n end", "def border_diagonal()\n return get_border(:diagonal)\n end", "def diagonals\n container = Array.new()\n diag_array_1 = []\n diag_array_2 = []\n for i in 0..@size-1\n diag_array_1 << i * (@size+1) \n end\n for i in 0..@size-1\n diag_array_2 << (i * (@size-1)) + @size-1\n end\n container << diag_array_1\n container << diag_array_2\n return container\n end", "def diagonal_dirs\n moves = []\n # Add moves toward the top left...\n moves += grow_unblocked_moves_in_dir(-1, -1)\n # ...the bottom left...\n moves += grow_unblocked_moves_in_dir(-1, 1)\n # ...the top right...\n moves += grow_unblocked_moves_in_dir( 1, -1)\n # ...and the bottom right.\n moves += grow_unblocked_moves_in_dir( 1, 1) \n moves\n end", "def gen_diagonal_up(row,col)\n array_diagonals =[]\n 0.upto(5).each do |num|\n if ( row - num < 0 || col + num > 6)\n break\n end\n\n array_diagonals << [row-num, col+num] \n end\n array_diagonals.map{|coordinates| @grid[coordinates[1]][coordinates[0]]}\n end", "def draw_diagonal_from_top_left(png, color)\n\tpng.polygon([0, 0, png.width, png.height], color)\nend", "def part_of_diag_r_down(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] - 1\n while x > ending[0]\n result << @boxes[x][y]\n x -= 1\n y -= 1\n end\n result\n end", "def board_diagonal_values(board, left_diagonal = true)\n values = []\n start_at = left_diagonal ? 1 : 3\n BOARD_HEIGHT.times do\n values << board[start_at]\n start_at += BOARD_WIDTH\n start_at = left_diagonal ? start_at + 1 : start_at - 1\n end\n values\nend", "def make_diagonal_array(horizontal_array, vertical, horizontal)\n diagonal_array = []\n until vertical > 19 || horizontal < 0 do\n diagonal_array << horizontal_array[vertical][horizontal]\n vertical += 1\n horizontal -= 1\n end\n diagonal_array\nend", "def diagonals\n [\n [@board[0][0], @board[1][1], @board[2][2]],\n [@board[0][2], @board[1][1], @board[2][0]]\n ]\n end", "def diagonal(a)\n rows = a.length\n cols = a[0].length\n result = []\n i, j = 0, 0\n # traverse from right to left on col\n while j < cols\n i = 0\n result << diagonalAt(a, i, j, rows)\n j += 1\n end\n # start from 1 we don't want repeatation\n i = 1\n while i < rows\n j = cols - 1\n result << diagonalAt(a, i, j, rows)\n i += 1\n end\n result\n end", "def part_of_diag_l_up(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] + 1\n while x > ending[0] && y < ending[1]\n result << @boxes[x][y]\n x -= 1\n y += 1\n end\n result\n end", "def outer_spiral_and_inner(a) \n\n # get the dimension of the matrix\n n = Math.sqrt(a.length).to_i \n\n # first row\n outer = Array.new\n for c in 0..n-1 \n outer << a[c]\n end\n\n if a.length > 1 # done if a.length <= 1\n # right side edge\n for r in 2..n-1 \n outer << a[r*n-1]\n end\n\n # last row going right to left\n (n*n-1).downto((n-1)*n) do |c| \n outer << a[c]\n end\n\n # left side edge bottom up\n (n-2).downto(1) do |r| \n outer << a[r*n]\n end\n\n # get the inner matrix\n inner = Array.new\n for r in 1..n-2\n for c in 1..n-2\n inner << a[r*n+c]\n end\n end\n end\n\n return outer, inner\nend", "def diagonal_coordinates\n r = @size - 1\n hsh = {diagonal_one_coordinates: [],diagonal_two_coordinates: []}\n #building diagonal one\n (0...@size).each do |x|\n hsh[:diagonal_one_coordinates] << [x,x]\n end\n\n #building diagonal two\n (0...@size).each do |x|\n hsh[:diagonal_two_coordinates] << [x,r]\n r -=1\n end\n hsh\n end", "def take(current_position)\n if direction == 1\n diagonals(current_position, 1)[0..1]\n elsif direction == 2\n diagonals(current_position, 1)[1...-1]\n end\n end", "def diagnoal(offset=0)\n\t\tdiag = Array.new()\n\t\t\n\t\tif(offset >= 0)\n\t\t\t0.upto(width - 1 - offset) {|i| diag.push(self[i][i+offset])}\n\t\telse\n\t\t\toffset = -offset\n\t\t\t0.upto(height - 1 - offset) {|i| diag.push(self[i+offset][i])}\n\t\tend\n\t\n\t\treturn diag\n\tend", "def get_diagonal_moves\n northwest_moves = []\n northeast_moves = []\n southwest_moves = []\n southeast_moves = []\n (1...ChessBoardConstants::BOARD_DIMENSIONS).each do |step|\n northwest_moves << { row: @row + step, col: @col - step }\n northeast_moves << { row: @row + step, col: @col + step }\n southwest_moves << { row: @row - step, col: @col - step }\n southeast_moves << { row: @row - step, col: @col + step }\n end\n return select_legal_moves(northwest_moves) +\n select_legal_moves(northeast_moves) +\n select_legal_moves(southwest_moves) +\n select_legal_moves(southeast_moves)\n end", "def traverse_spiral(matrix)\n l = 0\n r = matrix[0].length - 1\n b = matrix.length - 1\n t = 0\n dir = 0\n\n # loop until top bound equals bottom bounds and left bounds equals right\n while (t <= b && l <= r)\n\n if dir == 0\n (l..r).each{ |left_index| puts matrix[t][left_index] }\n t += 1\n end\n\n if dir == 1\n (t..b).each{ |top_col_ind| puts matrix[top_col_ind][r] }\n r -= 1\n end\n\n if dir == 2\n (r).downto(l) { |right_index| puts matrix[b][right_index] }\n b -= 1\n end\n\n if dir == 3\n (b).downto(t) { |bot_col_index| puts matrix[bot_col_index][l] }\n l += 1\n end\n\n dir = (dir + 1) % 4\n end\nend", "def diagonals\n [\n [self.r1_c1, self.r2_c2, self.r3_c3],\n [self.r1_c3, self.r2_c2, self.r3_c1]\n ]\n end", "def antidiagonal_starts\n result = []\n # Insert the antidiagonal starts along the bottom edge first, beginning on\n # the right side\n (1..size).each do |n|\n result.push MatrixPosition.new(size-1, size-n)\n end\n\n # Start at 2 since the last iterator covered (size-1, 0)\n (2..size).each do |n|\n result.push MatrixPosition.new(size-n, 0)\n end\n\n result\n end", "def diagonal main_diagonal=true\n diag_size = [cols, rows].min\n diag = NMatrix.new [diag_size], dtype: dtype\n\n if main_diagonal\n 0.upto(diag_size-1) do |i|\n diag[i] = self[i,i]\n end\n else\n row = 0\n (diag_size-1).downto(0) do |col|\n diag[row] = self[row,col]\n row += 1\n end\n end\n\n diag\n end", "def right_to_diagonal_left_approach\n largest_prod = 0\n\n for each_row in (0..15)\n for col in (0..19)\n each_col = 19 - col\n a = $grid_of_numbers[each_row][each_col]\n b = $grid_of_numbers[each_row+1][each_col-1]\n c = $grid_of_numbers[each_row+2][each_col-2]\n d = $grid_of_numbers[each_row+3][each_col-3]\n #puts \"#{a} #{b} #{c} #{d}\"\n curr_prod = a*b*c*d\n if curr_prod > largest_prod\n largest_prod = curr_prod\n end\n end\n end\n \n return largest_prod\nend", "def diagonalLines\n Pxlsrt::Lines.getDiagonals(horizontalLines.flatten(1), @width, @height)\n end", "def diagonals\n s = board_state\n first_diagonal = s[0] + s[4] + s[8]\n second_diagonal = s[2] + s[4] + s[6]\n [first_diagonal, second_diagonal]\n end", "def spiral_order(a)\n return [] if a.empty?\n res = []\n left, top = 0, 0\n bottom, right = a.length - 1, a[0].length - 1\n\n while left <= right && top <= bottom\n for i in (left..right)\n res << a[top][i]\n end\n top += 1\n for i in (top..bottom)\n res << a[i][right]\n end\n right -= 1\n if top <= bottom\n # decreament for loop\n for i in (right).downto(left)\n res << a[bottom][i] \n end\n bottom -= 1\n end\n if left <= right\n for i in (bottom).downto(top)\n res << a[i][left]\n end\n left += 1\n end\n end\n res\nend", "def check_diagonal?(side)\n i = -1\n j = 3\n dia_left = all? do |child|\n i += 1\n child[i] == side\n end\n dia_right = all? do |child|\n j -= 1\n child[j] == side\n end\n dia_left || dia_right\n end", "def move_diagonal(horz, vert)\r\n @move_succeed = diagonal_passable?(x, y, horz, vert)\r\n if @move_succeed\r\n @x = $game_map.round_x_with_direction(@x, horz)\r\n @y = $game_map.round_y_with_direction(@y, vert)\r\n @real_x = $game_map.x_with_direction(@x, reverse_dir(horz))\r\n @real_y = $game_map.y_with_direction(@y, reverse_dir(vert))\r\n increase_steps\r\n end\r\n set_direction(horz) if @direction == reverse_dir(horz)\r\n set_direction(vert) if @direction == reverse_dir(vert)\r\n end", "def sum_diagonals(width)\r\n\t# Start on 1 so sum = 1\r\n\tsum = 1\r\n\tcounter = 1\r\n\t# Iterate through number of layers of spiral\r\n\t(2...width).step(2).each do |x|\r\n\t\t# Sum diagonals for each side\r\n\t\t4.times do\r\n\t\t\tcounter += x\r\n\t\t\tsum += counter\r\n\t\tend\r\n\tend\r\n\tputs sum\r\nend", "def diagonal(height, lenght)\n printf \"Staciakampio istrizaine: #{Math.sqrt((height * height) + (lenght * lenght))} \\n\"\n end", "def diagonal_move\n (@initial_pos[0] - @final_pos[0]).abs == (@initial_pos[1] - @final_pos[1]).abs\n end", "def get_diagonal(representation)\n diagonals = []\n for k in (0..7)\n arr = []\n arr2 = []\n for i in (0..6)\n for j in (0..5)\n if (i == (j - k))\n arr << representation[i][j]\n end\n if ((i-k) == j)\n arr2 << representation[i][j]\n end\n end\n end\n diagonals.push(arr, arr2)\n end\n\n determine_winner(diagonals)\nend", "def move_diagonal(horz, vert)\r\r\n pixelstep = CXJ::FREE_MOVEMENT::PIXELS_PER_STEP / 32.0\r\r\n @move_poll+= [[vert + (horz > 5 ? 1 : -1), true]] * (distance_per_frame / pixelstep).ceil\r\r\n end", "def diagonal_dir\n diag_or_lat(DIAGONAL_DIRS)\n end", "def diagonalDifference(arr)\n (0...arr.size).inject(0) do |acc, index|\n left = arr[index][calc_left(arr.size, index)]\n right = arr[index][calc_right(arr.size, index)]\n acc + (left - right)\n end.abs\nend", "def diagonal(row, col, n)\n possible_moves = []\n (-n..n).each do |delta_right_diag|\n possible_moves << [row + delta_right_diag, col + delta_right_diag]\n end\n (-n..n).each do |delta_left_diag|\n possible_moves << [row - delta_left_diag, col + delta_left_diag]\n end\n possible_moves\n end", "def diagonal\n raise NonSquareException, \"Can not get diagonal of non-square matrix.\" unless square?\n\n diag = Array.new(@rows, 0)\n iter = iterator\n while iter.has_next?\n item = iter.next\n diag[item[0]] = item[2] if item[0] == item[1]\n end\n diag\n end", "def rotate_matrix(len, mtx)\n (0..(len / 2)).each do |layer|\n first = layer\n last = len - 1 - layer\n (first..last - 1).each do |i|\n top = mtx[first][i]\n mtx[first][i] = mtx[last - i][first] # TOP <-- LEFT\n mtx[last - i][first] = mtx[last][last - i] # LEFT <-- BOTTOM\n mtx[last][last - i] = mtx[i][last] # BOTTOM <-- RIGHT\n mtx[i][last] = top\n end\n end\n mtx\nend", "def diagonal_up_to_string(row_index, col_index)\n #move to edge\n until row_index == @rows - 1 || col_index == 0\n row_index += 1\n col_index -= 1\n end\n\n #form diagonal string from edge\n diagonal_string = \"\"\n while row_index > 0 && col_index < @cols\n diagonal_string += @grid[row_index][col_index]\n row_index -= 1\n col_index += 1\n end\n diagonal_string\n end", "def d; Matrix.new(RAtlas.vec2diag(@storage)); end", "def diagonals(arr)\n \n #define slices of array where diagonal lines can be drawn \n slices = [arr[23..36],arr[43..56],arr[63..76],arr[83..96],arr[103..116],arr[123..136],arr[143..156],arr[163..176]]\n \n #define holders for results \n diagonal_ans = []\n helper_hash = {}\n\n slices.map do |slice|\n for i in slice\n #make two sets of diagonals for each index currently selected\n #because the number of elements in each diagonal is 4, so there is no center element\n key_num1 = (arr[i-19]*arr[i]*arr[i+21]*arr[i+42])\n key_num2 = (arr[i-38]*arr[i-19]*arr[i]*arr[i+21])\n val_arr1 = [arr[i-19],arr[i],arr[i+21],arr[i+42]]\n val_arr2 = [arr[i-38],arr[i-19],arr[i],arr[i+21]]\n \n #retain the larger of the two possible diagonals for a given element \n key_num1 > key_num2 ? helper_hash[key_num1] = val_arr1 : helper_hash[key_num2] = val_arr2\n \n end\n diagonal_ans = helper_hash.max_by{|k,v| v}\n end\n @@maximums << diagonal_ans\n puts \"Diagonal max is\"\n p diagonal_ans\n\n end", "def in_ascending_diagonal?\n if @board.each_with_index.map {|row, index| row[4-index]} == @key\n true\n else\n false\n end\n end", "def valid_diagonal(top, right, n)\n bits = 0\n\n if top\n if right\n (@size - n).times { |i|\n if @state[((@size + 1) * i) + n]\n bits += 1\n end\n }\n else\n (n + 1).times { |i|\n if @state[((@size - 1) * i) + n]\n bits += 1\n end\n }\n end\n else\n n_pos = n + ((@size - 1) * @size)\n if right\n (@size - n).times { |i|\n if @state[n_pos - ((@size - 1) * i)]\n bits += 1\n end\n }\n else\n (n + 1).times { |i|\n if @state[n_pos - ((@size + 1) * i)]\n bits += 1\n end\n }\n end\n end\n\n if bits > 1\n return false\n else\n return true\n end\n end", "def topLeftToBottomRight(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-right half of the grid, including the longest diagonal\n for x in 1..width do\n\n string = \"\"\n\n for y in 0..x-1 do\n\n letter = grid[[width-x + y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-left half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x-y, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n\n end\n\n return strings\n\nend", "def spiral(rows, cols)\n # check for and handle wonky inputs\n if !rows.is_a?(Integer) || rows <= -1\n puts \"Whoops: Input rows = #{rows} is invalid; rows must be an integer >= 0.\"\n return\n elsif !cols.is_a?(Integer) || cols <= -1\n puts \"Whoops: Input cols = #{cols} is invalid; cols must be an integer >= 0.\"\n return\n end\n\n # prepare rows & columns in array of arrays\n res = Array.new(rows) { Array.new(cols) }\n level = 0 # count of cycles\n num = 1\n\n until num > (rows * cols)\n # top going right\n level.upto(cols-level-1) do |i|\n res[level][i] = num\n num += 1\n end\n break if num > (rows * cols)\n\n # right going down\n (level+1).upto(rows-level-1) do |i|\n res[i][cols-level-1] = num\n num += 1\n end\n break if num > (rows * cols)\n\n # bottom going left\n (cols-level-2).downto(level) do |i|\n res[rows-level-1][i] = num\n num += 1\n end\n break if num > (rows * cols)\n\n # left going up\n (rows-level-2).downto(level+1) do |i|\n res[i][level] = num\n num += 1\n end\n level += 1 # level completed\n end\n\n # print as matrix\n res.each {|sub_arr| print sub_arr, \"\\n\"}\nend", "def count_diagonals(x, y)\n total_count = 0\n \n # Upper Left\n if x - 1 >= 0 and y + 1 < $height and $canvas[x - 1][y + 1] == 1 then total_count += 1 end\n # Bottom Left\n if x - 1 >= 0 and y - 1 >= 0 and $canvas[x - 1][y - 1] == 1 then total_count += 1 end\n # Upper Right\n if x + 1 < $width and y + 1 < $height and $canvas[x + 1][y + 1] == 1 then total_count += 1 end\n # Bottom Right\n if x + 1 < $width and y - 1 >= 0 and $canvas[x + 1][y - 1] == 1 then total_count += 1 end\n\n return total_count\nend", "def topRightToBottomLeft(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-left half of the grid, including the longest diagonal\n for x in 0..width-1 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x - y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-right half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[width - x + y - 1, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n end\n\n return strings\nend", "def left_tri(tri)\n\nend", "def sum_of_diagonals\r\n\tresult = []\r\n\tresult.push 1\r\n\twidth = 3\r\n\twhile width <= 1001\r\n\t\tresult.push width**2, width**2 - (width-1), width**2 - (width-1)*2, width**2 - (width-1)*3\r\n\t\twidth += 2\r\n\tend\r\n\treturn result.reduce(:+)\r\nend", "def minor_diagnoal(offset=0)\n\t\tdiag = Array.new()\n\t\tif(offset >= 0)\n\t\t\t0.upto(height-1-offset) {|i| diag.push(self[i][width-1-offset-i])}\n\t\telse\n\t\t\toffset = -offset\n\t\t\toffset.upto(height-1) {|i| diag.push(self[i][width-i+offset-1])}\n\n\t\tend\n\t\n\t\treturn diag\n\tend", "def moves\n diagonal_dirs\n end", "def diagonal_dirs\n move_set = []\n move_set += grow_unblocked_moves_in_dir(1, -1)\n move_set += grow_unblocked_moves_in_dir(1, 1)\n move_set += grow_unblocked_moves_in_dir(-1, -1)\n move_set += grow_unblocked_moves_in_dir(-1, 1)\n end", "def secondary_diag(pos)\n row, col = pos\n arr = []\n\n until row == 0 || col == @board.length - 1\n row -= 1\n col += 1\n end\n\n while valid_idx?([row, col])\n arr << @board[row][col]\n row += 1\n col -= 1\n end\n\n arr\n end", "def diagonal_c4?\n diagonal_up_c4? || diagonal_down_c4?\n end", "def diagonalDifference(arr)\n n = arr.length\n primary = (0..n - 1).reduce(0) do |sum, i|\n sum + arr[i][i]\n end\n secondary = (0..n - 1).reduce(0) do |sum, i|\n sum + arr[i][n - 1 - i]\n end\n (primary - secondary).abs\nend", "def bottom_right_to_top_left(x1, y1, x2, y2)\n @spiral_array ||= []\n\n # Traversing bottom right to bottom left\n (x2).downto(x1).each do |i|\n @spiral_array << self[y2][i]\n end\n\n # Traversing bottom left to top left\n (y2 - 1).downto(y1).each do |j|\n @spiral_array << self[j][x1]\n end\n\n @spiral_array\n end", "def diagonal_traversal(matrix)\n raise NotImplementedError, \"This method has not yet been implemented\"\nend", "def right_tri(tri)\n\nend", "def diagAve(arr, i, j) # (arr= input, i=0 , j = 0)\n \n nums = [arr[i][j]]\n\n # we iterate through matrix as long as we are inbound\n while (i+1 > 0 && j-1 >= 0)\n\n if (i+1 < arr.length && j-1 < arr[0].length)\n i+=1\n j-=1\n nums.push(arr[i][j])\n else\n break\n end\n end\n\n length = nums.length\n (nums.reduce(:+))/length\nend", "def check_left_diagonal\n if @game_array[0][0] == @game_array[1][1] &&\n @game_array[0][0] == @game_array[2][2] &&\n !@game_array[0][0].nil?\n\n @game_array[0][0]\n end\n end", "def check_diagonal2\n cell = @last_cell_played\n count = 1\n while cell.rd && cell.rd.color == cell.color\n cell = cell.rd\n end\n while cell.lu && cell.lu.color == cell.color\n cell = cell.lu\n count += 1\n end\n return true if count >= 4\n false\n end", "def check_diagonally_left(x, y, numbers_in_product)\n (0...numbers_in_product).inject(1) do |product, i|\n product * matrix[y+i][x-i]\n end\n end", "def top_left_to_bottom_right(x1, y1, x2, y2)\n @spiral_array ||= []\n\n # Traversing top left to top right\n (x1..x2).each do |i|\n @spiral_array << self[y1][i]\n end\n\n # Traversing top right to bottom right\n ((y1 + 1)..(y2)).each do |j|\n @spiral_array << self[j][x2]\n end\n\n @spiral_array\n end", "def diagonals\n [\n Diagonal.new(position: 0,cells: diagonal_cells(diagonal_coordinates[:diagonal_one_coordinates])),\n Diagonal.new(position: 1,cells: diagonal_cells(diagonal_coordinates[:diagonal_two_coordinates]))\n ]\n end", "def diagonal_difference(arr)\n size = arr.size\n left_diagonal = 0\n right_diagonal = 0\n\n for i in 0..(size - 1)\n left_diagonal += arr[i][i]\n right_diagonal += arr[i][size - i - 1]\n end\n\n (left_diagonal - right_diagonal).abs\nend", "def potential_diagonal_moves is_king=false\n moves = []\n\n # Possible moves\n # - all possible combination of increment/decrement of r_idx/c_idx\n\n r_min = is_king ? (r_idx - 1 >= 0 ? r_idx - 1 : r_idx) : 0\n c_min = is_king ? (c_idx - 1 >= 0 ? c_idx - 1 : c_idx) : 0\n r_max = is_king ? (r_idx + 1 <= 7 ? r_idx + 1 : r_idx) : Board::WIDTH - 1\n c_max = is_king ? (c_idx + 1 <= 7 ? c_idx + 1 : c_idx) : Board::WIDTH - 1\n\n # top-right: row-decrement, column-increment [4, 5] [3, 6]\n r = r_idx - 1\n c = c_idx + 1\n while (r >= r_min) && (c <= c_max)\n moves << [r, c]\n r -= 1\n c += 1\n end\n\n # bottom-right: row-increment, column-increment [4, 5] [5, 6]\n r = r_idx + 1\n c = c_idx + 1\n while (r <= r_max) && (c <= c_max)\n moves << [r, c]\n r += 1\n c += 1\n end\n\n # bottom-left: row-increment, column-decrement [4, 5] [5, 4]\n r = r_idx + 1\n c = c_idx - 1\n while (r <= r_max) && (c >= c_min)\n moves << [r, c]\n r += 1\n c -= 1\n end\n\n # top-left: row-decrement, column-decrement [4, 5] [3, 4]\n r = r_idx - 1\n c = c_idx - 1\n while (r >= r_min) && (c >= c_min)\n moves << [r, c]\n r -= 1\n c -= 1\n end\n\n # TODO\n # - refactor to avoid repeated pattern of code without compromising with runtime\n\n moves\n end", "def rDiagonalXY(d, i)\n cr = diagonalColumnRow(d, i)\n {\n 'x' => @width - 1 - cr['column'],\n 'y' => cr['row']\n }\n end", "def get_diagonal_difference(\n matrix:\n )\n primary_dia, secondary_dia = 0, 0\n array_length = matrix[0].length - 1\n # Calculate diagonal sum\n (0...matrix[0].length).each do |index|\n \tprimary_dia += matrix[index][index]\n \tsecondary_dia += matrix[index][array_length]\n \tarray_length -= 1\n end\n # Return absolute value of the difference between to diagonals\n (primary_dia - secondary_dia).abs\nend", "def diagonal_paths(direction)\n off_gen = DiagonalOffsetGenerator.new(coordinates, direction)\n off_gen.moves\n end", "def check_diagonal1\n cell = @last_cell_played\n count = 1\n while cell.ld && cell.ld.color == cell.color\n cell = cell.ld\n end\n while cell.ru && cell.ru.color == cell.color\n cell = cell.ru\n count += 1\n end\n return true if count >= 4\n false\n end", "def pawn_diagonal?(x,y)\n diagonal?(x, y) && x_diff(x) == 1\n end", "def diagonalDifference(arr)\n # Write your code here\n d1 = 0\n d2 = 0\n\n (0..arr.length - 1).each do |i|\n d1 = d1 + arr[i][i]\n d2 = d2 + arr[-i-1][i]\n end\n (d1 - d2).abs\nend", "def sum_diagonals(n)\n return n if n <= 1\n 4 * (n**2) - 6 * (n-1) + sum_diagonals(n-2)\nend", "def diagonalSum(matrix)\ntotal = 0\n (0...matrix.length).each {|sub| total += matrix[sub][sub]}\nreturn total\nend", "def win_diagonal?(mark)\n ltr_diagonal = []\n rtl_diagonal = []\n @grid.each.with_index do |row,r|\n row.each.with_index do |col,c|\n if r == c \n ltr_diagonal << col\n end\n \n if (row.length - r - 1) == c\n rtl_diagonal << col\n end\n end\n end\n ltr = (ltr_diagonal.uniq.length == 1) && ltr_diagonal.include?(mark) \n rtl = (rtl_diagonal.uniq.length == 1) && rtl_diagonal.include?(mark)\n ltr || rtl\n\n end", "def diag_abs(mat)\n\tdiag1 = 0\n\tdiag2 = 0\n\t(0..mat.size-1).each do |i|\n \tdiag1 += mat[i][i].to_i\n \tdiag2 += mat[i][mat.size-i-1].to_i\n\tend\n\t(diag1-diag2).abs\nend", "def check_right_diagonal\n if @game_array[0][2] == @game_array[1][1] &&\n @game_array[0][2] == @game_array[2][0] &&\n !@game_array[0][2].nil?\n\n @game_array[0][2]\n end\n end", "def diagonalDifference(arr)\n\n sum_diagonal_1 = arr.each_with_index.map{|sb_arr, index| sb_arr[index]}.reduce(:+)\n\n sum_diagonal_2 = arr.reverse.each_with_index.map{|sb_arr, index| sb_arr[index]}.reduce(:+)\n\n diff = (sum_diagonal_1 - sum_diagonal_2).abs()\n\n return diff\nend", "def diagonal_size\n Math.sqrt( @room_height * @room_height + @room_width * @room_width ).round(0)\n end", "def diagonalDifference(a)\n diff = right_diagonal_sum(a) - left_diagonal_sum(a)\n return diff.abs\nend", "def rotate(matrix, start_row, start_col, end_row, end_col, rotations)\n edge = []\n\n # top\n edge.concat start_col.upto(end_col - 1).collect { |c| matrix[start_row][c] }\n # right\n edge.concat start_row.upto(end_row - 1).collect { |r| matrix[r][end_col] }\n # bottom\n edge.concat end_col.downto(start_col + 1).collect { |c| matrix[end_row][c] }\n # left\n edge.concat end_row.downto(start_row + 1).collect { |r| matrix[r][start_col] }\n\n rotated = edge[rotations..-1] + edge[0, rotations]\n\n # top\n i = 0\n start_col.upto(end_col - 1) do |c|\n matrix[start_row][c] = rotated[i]\n i += 1\n end\n\n # right\n start_row.upto(end_row - 1) do |r|\n matrix[r][end_col] = rotated[i]\n i += 1\n end\n\n # bottom\n end_col.downto(start_col + 1) do |c|\n matrix[end_row][c] = rotated[i]\n i += 1\n end\n\n # left\n end_row.downto(start_row + 1) do |r|\n matrix[r][start_col] = rotated[i]\n i += 1\n end\n\n matrix\nend", "def rotate_matrix matrix\n\tlayer = 0\n\tfor layer in 0..(matrix.size / 2).ceil\n\t\tlast = matrix.size - 1 - layer\n\t\tfor i in layer..last-1 # not sure here \n\t\t\toffset = i - layer\n\t\t\ttop = matrix[layer][i]\n\n\t\t\tmatrix[layer][i] = matrix[last - offset ][layer] #7 4\n\n\t\t\tmatrix[last - offset][layer] = matrix[ last ][ last - offset ] #9 8\n\n\t\t\tmatrix[ last ][ last - offset] = matrix[ i ][last ] #3 6\n\n\t\t\t#top -> right\n\t\t\tputs i\n\t\t\tputs last\n\t\t\tmatrix[ i ][ last] = top\n\t\tend\n\tend\n\nend", "def diagonal_difference(matrix)\n # find first diagonal\n first = []\n i = 0\n j = matrix[i].length-1\n while i < matrix.length\n first << matrix[i][j]\n i += 1 #1\n j -= 1 #1 \n end\n \n sum1 = first.reduce(:+)\n # loop through array of array adjusting for subindex\n second = []\n k = 0\n while k < matrix.length\n second << matrix[k][k]\n k += 1\n end\n \n sum2 = second.reduce(:+)\n \n (sum1-sum2).abs\n \n \n # find second diagonal\n # get abs diff\nend", "def in_descending_diagonal?\n if @board.each_with_index.map {|row, index| row[index]} == @key\n true\n else\n false\n end\n end", "def check_direction(origin_arr,destination_arr)\n\t\tdiagonal_direction(origin_arr,destination_arr)\n\tend", "def all_diagonals(columns)\n diagonals = []\n valid_col_rows = [\n [ [0,2], [1,3], [2,4], [3,5] ],\n [ [0,1], [1,2], [2,3], [3,4], [4,5] ],\n [ [0,0], [1,1], [2,2], [3,3], [4,4], [5,5] ],\n [ [1,0], [2,1], [3,2], [4,3], [5,4], [6,5] ],\n [ [2,0], [3,1], [4,2], [5,3], [6,4] ],\n [ [3,0], [4,1], [5,2], [6,3] ],\n\n [ [0,3], [1,2], [2,1], [3,0] ],\n [ [0,4], [1,3], [2,2], [3,1], [4,0] ],\n [ [0,5], [1,4], [2,3], [3,2], [4,1], [5,0] ],\n [ [1,5], [2,4], [3,3], [4,2], [5,1], [6,0] ],\n [ [2,5], [3,4], [4,3], [5,2], [6,1] ],\n [ [3,5], [4,4], [5,3], [6,2] ],\n ]\n\n valid_col_rows.each do |diag|\n diagonal = ''\n diag.each do |coords|\n symbol = columns[coords.first][coords.last]\n symbol.nil? ? diagonal += '-' : diagonal += symbol\n end\n diagonals << diagonal\n end\n diagonals\n end", "def drop_diagonal(x_vel, y_vel)\n (y_vel.abs > x_vel.abs) ? [0, y_vel] : [x_vel, 0]\n end", "def each_diagonal(&block)\n diags_coords = [[[1,1], [2,2], [3,3]],\n [[1,3], [2,2], [3,1]]]\n diags = diags_coords.map do |diag_coords|\n diag_coords.map do |l, c|\n self[l,c]\n end\n end\n\n each_for diags, &block\n end" ]
[ "0.7465372", "0.6961317", "0.6956885", "0.6897699", "0.68156993", "0.6783061", "0.6779543", "0.6760683", "0.66843647", "0.665417", "0.6599142", "0.6584765", "0.65793014", "0.6518524", "0.65104765", "0.6468214", "0.6460205", "0.64529014", "0.6444333", "0.64419717", "0.6421348", "0.6404735", "0.6351464", "0.62980133", "0.6277542", "0.6259245", "0.6178217", "0.6168993", "0.61419576", "0.6140034", "0.6122583", "0.61055064", "0.6099738", "0.60873383", "0.6037", "0.60330975", "0.60304236", "0.60001564", "0.59822863", "0.597566", "0.5966207", "0.5961491", "0.59557486", "0.59272885", "0.5921741", "0.5900589", "0.5899538", "0.58932734", "0.5888695", "0.58850247", "0.5871961", "0.58693796", "0.58544666", "0.5851951", "0.5829261", "0.58129007", "0.5810389", "0.57901084", "0.57833076", "0.57764655", "0.57737494", "0.5773003", "0.57634705", "0.5750527", "0.5748744", "0.57425886", "0.5737234", "0.57291853", "0.5720082", "0.5717012", "0.57048935", "0.57020414", "0.5697044", "0.5691038", "0.56724495", "0.567235", "0.56587446", "0.56418836", "0.56407595", "0.56324106", "0.56194407", "0.5609565", "0.5586224", "0.55758077", "0.5574998", "0.55593395", "0.5547489", "0.5536021", "0.5532515", "0.5527344", "0.5515382", "0.55096453", "0.54913783", "0.5486425", "0.5482036", "0.54816884", "0.54320693", "0.5431173", "0.54270273", "0.5416083" ]
0.6128675
30
Diagonal Top right to bottom left approach
def right_to_diagonal_left_approach largest_prod = 0 for each_row in (0..15) for col in (0..19) each_col = 19 - col a = $grid_of_numbers[each_row][each_col] b = $grid_of_numbers[each_row+1][each_col-1] c = $grid_of_numbers[each_row+2][each_col-2] d = $grid_of_numbers[each_row+3][each_col-3] #puts "#{a} #{b} #{c} #{d}" curr_prod = a*b*c*d if curr_prod > largest_prod largest_prod = curr_prod end end end return largest_prod end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def diagonal_left\n end", "def diagonalize floor = 0\n raise 'err: not 2d' unless self[0].class == Array\n size = self.length + self[0].length - 1\n array = Array.new(size) {Array.new}\n # acquire top and main diagonal\n self.length.times do |row|\n (0 .. row).each do |col|\n array[row] << self[row-col][col]\n end\n end\n # now cover the additional bottom diagonals\n sides_difference = self.length[0] - self.length\n if sides_difference == 0\n (1 .. self.length - 1).reverse_each do |row|\n offset_value = 0\n temp_arr = []\n while row + offset_value < self.length\n temp_arr << self[self.length - 1 - offset_value][row + offset_value]\n offset_value += 1\n end\n array[self.length - 1 + row] = temp_arr\n end\n else\n (1 .. self[0].length - 1).reverse_each do |row|\n offset_value = 0\n temp_arr = []\n while row + offset_value < self[0].length\n temp_arr << self[self.length - 1 - offset_value][row + offset_value]\n offset_value += 1\n end\n array[self[0].length - 2 + row] = temp_arr\n end\n end\n\n # phew... now to trim and format\n unless floor == 0\n index = 0\n while index < size\n if array[index].length < floor\n array.slice! index\n size -= 1\n index -= 1\n end\n index += 1\n end\n end\n\n (0..size-1).each do |index|\n while array[index].length < self.length\n array[index] << nil\n end\n end\n array\n end", "def diagonals\n down_diag = []\n up_diag = []\n \n # push sets of coordinates that make up both diagonals\n 0.upto(@size - 1) do |idx|\n down_diag << [idx, idx]\n up_diag << [idx, @size - 1 - idx]\n end\n\n [down_diag, up_diag].map do |diag|\n diag.map { |pos| self[pos] }\n end\n end", "def diagonals\n vals = [[], []]\n (0...size).each do |i|\n vals[0].push(get_square({:column => i, :row => i}))\n vals[1].push(get_square({:column => i, :row => size - i - 1}))\n end\n vals.map {|v| Row.new(size, {:vals => v}) }\n end", "def rDiagonalLines\n Pxlsrt::Lines.getDiagonals(horizontalLines.reverse.flatten(1).reverse, @width, @height)\n end", "def diagonals\n [board.map.with_index { |row, i| row[i] },\n board.map.with_index { |row, i| row[row.size - i - 1] }]\n end", "def diagonal_slide(row, col) # oh cool try the .downto here instead of the reverse always nice to try new things even though it doesn't make for the most sensical code as per https://stackoverflow.com/questions/2070574/is-there-a-reason-that-we-cannot-iterate-on-reverse-range-in-ruby love it the last time you did reverse just because you didn't think about it until later now knowing this you can do it this way love it ah nevermind no need but would have been great to write smaller.downto(0).map oh well lol remember that for some other time love Ruby what a great language\n (row <= col) ? (smaller, larger = row, col) : (smaller, larger = col, row) # establish which number is the smaller of the two and the larger love it you have some crazy short code lol. For the nw and se diagonals\n nw = check_blocking_pieces((1..smaller).map { |offset| [row-offset, col-offset] }) # go by smaller because that's which one will hit 0 first\n ne = check_blocking_pieces((1..(7-row)).map { |offset| [row+offset, col-offset] if ((col-offset) >= 0) }.compact) # Need to use .compact to remove all the nil elements that were returned by .map since can't quite use select or reject since you *do* want to return the evaluation of the array but ah well code smells http://ruby-doc.org/core-1.9.3/Array.html#method-i-compact if you don't get rid of these nils then in the check_blocking_pieces() you'll run into an error since it'll be trying to get an index of a nil value in moves lol amaizng that even the most misleading errors you can debug with debugger and a good eye fuck byebug is so powerful # go by larger but check that the thing doesn't go out of bounds, the only bounds that it could go out if you have the row correct is col-offset being less than 0 # ahh these return nil for everything it doesn't return for so that's the error love it great catch # don't know what you would do without byebug it's literally god mode\n sw = check_blocking_pieces((1..(7-col)).map { |offset| [row-offset, col+offset] if ((row-offset) >= 0) }.compact) # go up until col == 7 as long as row is above or equal to 0, could do it the other way too, as long as col <= 7 go until row hits 0, but same thing\n se = check_blocking_pieces((1..(7-larger)).map { |offset| [row+offset, col+offset] }) # increase up until the largest one equals 7 basically there might be some nil issues with this but this should work can't wait to check it if you add them all up and there are some nils they might not add let's see, ah nope thankfully map returns an empty array fucking love it Ruby is the best\n (nw + ne + sw + se)\nend", "def main_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][i] }\n end", "def diagonals\n down_diag = [[0, 0], [1, 1], [2, 2]]\n up_diag = [[0, 2], [1, 1], [2, 0]]\n \n [down_diag, up_diag].map do |diag|\n diag.map { |row, col| @rows[row][col] }\n end\n end", "def minor_diagonal\n (0...@game.rows).collect { |i| @game.board.board[i][-i - 1] }\n end", "def diagonal_coords\n data_hsh = { forward: [], backward: [] }\n @width.times do |t|\n data_hsh[:forward].push([t + 1, t + 1])\n data_hsh[:backward].push([@width - t, t + 1])\n end\n data_hsh\n end", "def diagonal_left_right\n func = lambda do |arr, mark|\n return mark if arr.all? { |el| el == mark } end\n\n left = []; len = @grid.length\n (0...len).each { |i| left << @grid[i][i] }\n\n right = []; len = @grid.length - 1\n (0...@grid.length).each { |i| right << @grid[i][len-i] }\n\n return :X if (func.call(left, :X) == :X) || (func.call(right, :X) == :X)\n return :O if (func.call(left, :O) == :O) || (func.call(right, :O) == :O)\n end", "def part_of_diag_l_down(starting, ending)\n result = []\n x = starting[0] + 1\n y = starting[1] - 1\n while x < ending[0] && y > ending[1]\n result << @boxes[x][y]\n x += 1\n y -= 1\n end\n result\n end", "def diagonal_dirs\n moves = []\n # Add moves toward the top left...\n moves += grow_unblocked_moves_in_dir(-1, -1)\n # ...the bottom left...\n moves += grow_unblocked_moves_in_dir(-1, 1)\n # ...the top right...\n moves += grow_unblocked_moves_in_dir( 1, -1)\n # ...and the bottom right.\n moves += grow_unblocked_moves_in_dir( 1, 1) \n moves\n end", "def draw_diagonal_from_top_left(png, color)\n\tpng.polygon([0, 0, png.width, png.height], color)\nend", "def make_diagonal\n each{|x,y,val| set x,x,x+1 if x==y}\n self\n end", "def border_diagonal()\n return get_border(:diagonal)\n end", "def gen_diagonal_up(row,col)\n array_diagonals =[]\n 0.upto(5).each do |num|\n if ( row - num < 0 || col + num > 6)\n break\n end\n\n array_diagonals << [row-num, col+num] \n end\n array_diagonals.map{|coordinates| @grid[coordinates[1]][coordinates[0]]}\n end", "def part_of_diag_r_down(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] - 1\n while x > ending[0]\n result << @boxes[x][y]\n x -= 1\n y -= 1\n end\n result\n end", "def board_diagonal_values(board, left_diagonal = true)\n values = []\n start_at = left_diagonal ? 1 : 3\n BOARD_HEIGHT.times do\n values << board[start_at]\n start_at += BOARD_WIDTH\n start_at = left_diagonal ? start_at + 1 : start_at - 1\n end\n values\nend", "def diagonals\n container = Array.new()\n diag_array_1 = []\n diag_array_2 = []\n for i in 0..@size-1\n diag_array_1 << i * (@size+1) \n end\n for i in 0..@size-1\n diag_array_2 << (i * (@size-1)) + @size-1\n end\n container << diag_array_1\n container << diag_array_2\n return container\n end", "def make_diagonal_array(horizontal_array, vertical, horizontal)\n diagonal_array = []\n until vertical > 19 || horizontal < 0 do\n diagonal_array << horizontal_array[vertical][horizontal]\n vertical += 1\n horizontal -= 1\n end\n diagonal_array\nend", "def diagonals\n [\n [@board[0][0], @board[1][1], @board[2][2]],\n [@board[0][2], @board[1][1], @board[2][0]]\n ]\n end", "def diagonal(a)\n rows = a.length\n cols = a[0].length\n result = []\n i, j = 0, 0\n # traverse from right to left on col\n while j < cols\n i = 0\n result << diagonalAt(a, i, j, rows)\n j += 1\n end\n # start from 1 we don't want repeatation\n i = 1\n while i < rows\n j = cols - 1\n result << diagonalAt(a, i, j, rows)\n i += 1\n end\n result\n end", "def part_of_diag_l_up(starting, ending)\n result = []\n x = starting[0] - 1\n y = starting[1] + 1\n while x > ending[0] && y < ending[1]\n result << @boxes[x][y]\n x -= 1\n y += 1\n end\n result\n end", "def outer_spiral_and_inner(a) \n\n # get the dimension of the matrix\n n = Math.sqrt(a.length).to_i \n\n # first row\n outer = Array.new\n for c in 0..n-1 \n outer << a[c]\n end\n\n if a.length > 1 # done if a.length <= 1\n # right side edge\n for r in 2..n-1 \n outer << a[r*n-1]\n end\n\n # last row going right to left\n (n*n-1).downto((n-1)*n) do |c| \n outer << a[c]\n end\n\n # left side edge bottom up\n (n-2).downto(1) do |r| \n outer << a[r*n]\n end\n\n # get the inner matrix\n inner = Array.new\n for r in 1..n-2\n for c in 1..n-2\n inner << a[r*n+c]\n end\n end\n end\n\n return outer, inner\nend", "def diagnoal(offset=0)\n\t\tdiag = Array.new()\n\t\t\n\t\tif(offset >= 0)\n\t\t\t0.upto(width - 1 - offset) {|i| diag.push(self[i][i+offset])}\n\t\telse\n\t\t\toffset = -offset\n\t\t\t0.upto(height - 1 - offset) {|i| diag.push(self[i+offset][i])}\n\t\tend\n\t\n\t\treturn diag\n\tend", "def diagonal_coordinates\n r = @size - 1\n hsh = {diagonal_one_coordinates: [],diagonal_two_coordinates: []}\n #building diagonal one\n (0...@size).each do |x|\n hsh[:diagonal_one_coordinates] << [x,x]\n end\n\n #building diagonal two\n (0...@size).each do |x|\n hsh[:diagonal_two_coordinates] << [x,r]\n r -=1\n end\n hsh\n end", "def traverse_spiral(matrix)\n l = 0\n r = matrix[0].length - 1\n b = matrix.length - 1\n t = 0\n dir = 0\n\n # loop until top bound equals bottom bounds and left bounds equals right\n while (t <= b && l <= r)\n\n if dir == 0\n (l..r).each{ |left_index| puts matrix[t][left_index] }\n t += 1\n end\n\n if dir == 1\n (t..b).each{ |top_col_ind| puts matrix[top_col_ind][r] }\n r -= 1\n end\n\n if dir == 2\n (r).downto(l) { |right_index| puts matrix[b][right_index] }\n b -= 1\n end\n\n if dir == 3\n (b).downto(t) { |bot_col_index| puts matrix[bot_col_index][l] }\n l += 1\n end\n\n dir = (dir + 1) % 4\n end\nend", "def take(current_position)\n if direction == 1\n diagonals(current_position, 1)[0..1]\n elsif direction == 2\n diagonals(current_position, 1)[1...-1]\n end\n end", "def get_diagonal_moves\n northwest_moves = []\n northeast_moves = []\n southwest_moves = []\n southeast_moves = []\n (1...ChessBoardConstants::BOARD_DIMENSIONS).each do |step|\n northwest_moves << { row: @row + step, col: @col - step }\n northeast_moves << { row: @row + step, col: @col + step }\n southwest_moves << { row: @row - step, col: @col - step }\n southeast_moves << { row: @row - step, col: @col + step }\n end\n return select_legal_moves(northwest_moves) +\n select_legal_moves(northeast_moves) +\n select_legal_moves(southwest_moves) +\n select_legal_moves(southeast_moves)\n end", "def diagonals\n [\n [self.r1_c1, self.r2_c2, self.r3_c3],\n [self.r1_c3, self.r2_c2, self.r3_c1]\n ]\n end", "def left_to_diagonal_right_approach\n largest_prod = 0\n for each_row in (0..15)\n for each_col in (0..15)\n a = $grid_of_numbers[each_row][each_col]\n b = $grid_of_numbers[each_row+1][each_col+1]\n c = $grid_of_numbers[each_row+2][each_col+2]\n d = $grid_of_numbers[each_row+3][each_col+3]\n\n curr_prod = a*b*c*d\n if curr_prod > largest_prod\n largest_prod = curr_prod\n end\n end\n end\n \n return largest_prod\nend", "def antidiagonal_starts\n result = []\n # Insert the antidiagonal starts along the bottom edge first, beginning on\n # the right side\n (1..size).each do |n|\n result.push MatrixPosition.new(size-1, size-n)\n end\n\n # Start at 2 since the last iterator covered (size-1, 0)\n (2..size).each do |n|\n result.push MatrixPosition.new(size-n, 0)\n end\n\n result\n end", "def diagonal main_diagonal=true\n diag_size = [cols, rows].min\n diag = NMatrix.new [diag_size], dtype: dtype\n\n if main_diagonal\n 0.upto(diag_size-1) do |i|\n diag[i] = self[i,i]\n end\n else\n row = 0\n (diag_size-1).downto(0) do |col|\n diag[row] = self[row,col]\n row += 1\n end\n end\n\n diag\n end", "def diagonals\n s = board_state\n first_diagonal = s[0] + s[4] + s[8]\n second_diagonal = s[2] + s[4] + s[6]\n [first_diagonal, second_diagonal]\n end", "def diagonalLines\n Pxlsrt::Lines.getDiagonals(horizontalLines.flatten(1), @width, @height)\n end", "def spiral_order(a)\n return [] if a.empty?\n res = []\n left, top = 0, 0\n bottom, right = a.length - 1, a[0].length - 1\n\n while left <= right && top <= bottom\n for i in (left..right)\n res << a[top][i]\n end\n top += 1\n for i in (top..bottom)\n res << a[i][right]\n end\n right -= 1\n if top <= bottom\n # decreament for loop\n for i in (right).downto(left)\n res << a[bottom][i] \n end\n bottom -= 1\n end\n if left <= right\n for i in (bottom).downto(top)\n res << a[i][left]\n end\n left += 1\n end\n end\n res\nend", "def diagonal(height, lenght)\n printf \"Staciakampio istrizaine: #{Math.sqrt((height * height) + (lenght * lenght))} \\n\"\n end", "def check_diagonal?(side)\n i = -1\n j = 3\n dia_left = all? do |child|\n i += 1\n child[i] == side\n end\n dia_right = all? do |child|\n j -= 1\n child[j] == side\n end\n dia_left || dia_right\n end", "def diagonal_dir\n diag_or_lat(DIAGONAL_DIRS)\n end", "def rotate_matrix(len, mtx)\n (0..(len / 2)).each do |layer|\n first = layer\n last = len - 1 - layer\n (first..last - 1).each do |i|\n top = mtx[first][i]\n mtx[first][i] = mtx[last - i][first] # TOP <-- LEFT\n mtx[last - i][first] = mtx[last][last - i] # LEFT <-- BOTTOM\n mtx[last][last - i] = mtx[i][last] # BOTTOM <-- RIGHT\n mtx[i][last] = top\n end\n end\n mtx\nend", "def sum_diagonals(width)\r\n\t# Start on 1 so sum = 1\r\n\tsum = 1\r\n\tcounter = 1\r\n\t# Iterate through number of layers of spiral\r\n\t(2...width).step(2).each do |x|\r\n\t\t# Sum diagonals for each side\r\n\t\t4.times do\r\n\t\t\tcounter += x\r\n\t\t\tsum += counter\r\n\t\tend\r\n\tend\r\n\tputs sum\r\nend", "def move_diagonal(horz, vert)\r\n @move_succeed = diagonal_passable?(x, y, horz, vert)\r\n if @move_succeed\r\n @x = $game_map.round_x_with_direction(@x, horz)\r\n @y = $game_map.round_y_with_direction(@y, vert)\r\n @real_x = $game_map.x_with_direction(@x, reverse_dir(horz))\r\n @real_y = $game_map.y_with_direction(@y, reverse_dir(vert))\r\n increase_steps\r\n end\r\n set_direction(horz) if @direction == reverse_dir(horz)\r\n set_direction(vert) if @direction == reverse_dir(vert)\r\n end", "def diagonal(row, col, n)\n possible_moves = []\n (-n..n).each do |delta_right_diag|\n possible_moves << [row + delta_right_diag, col + delta_right_diag]\n end\n (-n..n).each do |delta_left_diag|\n possible_moves << [row - delta_left_diag, col + delta_left_diag]\n end\n possible_moves\n end", "def diagonal_move\n (@initial_pos[0] - @final_pos[0]).abs == (@initial_pos[1] - @final_pos[1]).abs\n end", "def diagonal\n raise NonSquareException, \"Can not get diagonal of non-square matrix.\" unless square?\n\n diag = Array.new(@rows, 0)\n iter = iterator\n while iter.has_next?\n item = iter.next\n diag[item[0]] = item[2] if item[0] == item[1]\n end\n diag\n end", "def diagonalDifference(arr)\n (0...arr.size).inject(0) do |acc, index|\n left = arr[index][calc_left(arr.size, index)]\n right = arr[index][calc_right(arr.size, index)]\n acc + (left - right)\n end.abs\nend", "def get_diagonal(representation)\n diagonals = []\n for k in (0..7)\n arr = []\n arr2 = []\n for i in (0..6)\n for j in (0..5)\n if (i == (j - k))\n arr << representation[i][j]\n end\n if ((i-k) == j)\n arr2 << representation[i][j]\n end\n end\n end\n diagonals.push(arr, arr2)\n end\n\n determine_winner(diagonals)\nend", "def diagonal_up_to_string(row_index, col_index)\n #move to edge\n until row_index == @rows - 1 || col_index == 0\n row_index += 1\n col_index -= 1\n end\n\n #form diagonal string from edge\n diagonal_string = \"\"\n while row_index > 0 && col_index < @cols\n diagonal_string += @grid[row_index][col_index]\n row_index -= 1\n col_index += 1\n end\n diagonal_string\n end", "def move_diagonal(horz, vert)\r\r\n pixelstep = CXJ::FREE_MOVEMENT::PIXELS_PER_STEP / 32.0\r\r\n @move_poll+= [[vert + (horz > 5 ? 1 : -1), true]] * (distance_per_frame / pixelstep).ceil\r\r\n end", "def topLeftToBottomRight(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-right half of the grid, including the longest diagonal\n for x in 1..width do\n\n string = \"\"\n\n for y in 0..x-1 do\n\n letter = grid[[width-x + y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-left half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x-y, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n\n end\n\n return strings\n\nend", "def topRightToBottomLeft(grid, width, height)\n\n strings = Array.new\n string = String.new\n\n # Get the top-left half of the grid, including the longest diagonal\n for x in 0..width-1 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[x - y, y]]\n\n string << letter\n\n end\n\n strings << string\n\n end\n\n # Get the bottom-right half of the grid, not including the longest diagonal\n # TODO: find a better way of doing this, without needing to reverse the string\n for x in 0..width-2 do\n\n string = \"\"\n\n for y in 0..x do\n\n letter = grid[[width - x + y - 1, height - y - 1]]\n\n string << letter\n\n end\n\n string.reverse!\n\n strings << string\n end\n\n return strings\nend", "def d; Matrix.new(RAtlas.vec2diag(@storage)); end", "def spiral(rows, cols)\n # check for and handle wonky inputs\n if !rows.is_a?(Integer) || rows <= -1\n puts \"Whoops: Input rows = #{rows} is invalid; rows must be an integer >= 0.\"\n return\n elsif !cols.is_a?(Integer) || cols <= -1\n puts \"Whoops: Input cols = #{cols} is invalid; cols must be an integer >= 0.\"\n return\n end\n\n # prepare rows & columns in array of arrays\n res = Array.new(rows) { Array.new(cols) }\n level = 0 # count of cycles\n num = 1\n\n until num > (rows * cols)\n # top going right\n level.upto(cols-level-1) do |i|\n res[level][i] = num\n num += 1\n end\n break if num > (rows * cols)\n\n # right going down\n (level+1).upto(rows-level-1) do |i|\n res[i][cols-level-1] = num\n num += 1\n end\n break if num > (rows * cols)\n\n # bottom going left\n (cols-level-2).downto(level) do |i|\n res[rows-level-1][i] = num\n num += 1\n end\n break if num > (rows * cols)\n\n # left going up\n (rows-level-2).downto(level+1) do |i|\n res[i][level] = num\n num += 1\n end\n level += 1 # level completed\n end\n\n # print as matrix\n res.each {|sub_arr| print sub_arr, \"\\n\"}\nend", "def in_ascending_diagonal?\n if @board.each_with_index.map {|row, index| row[4-index]} == @key\n true\n else\n false\n end\n end", "def valid_diagonal(top, right, n)\n bits = 0\n\n if top\n if right\n (@size - n).times { |i|\n if @state[((@size + 1) * i) + n]\n bits += 1\n end\n }\n else\n (n + 1).times { |i|\n if @state[((@size - 1) * i) + n]\n bits += 1\n end\n }\n end\n else\n n_pos = n + ((@size - 1) * @size)\n if right\n (@size - n).times { |i|\n if @state[n_pos - ((@size - 1) * i)]\n bits += 1\n end\n }\n else\n (n + 1).times { |i|\n if @state[n_pos - ((@size + 1) * i)]\n bits += 1\n end\n }\n end\n end\n\n if bits > 1\n return false\n else\n return true\n end\n end", "def diagonals(arr)\n \n #define slices of array where diagonal lines can be drawn \n slices = [arr[23..36],arr[43..56],arr[63..76],arr[83..96],arr[103..116],arr[123..136],arr[143..156],arr[163..176]]\n \n #define holders for results \n diagonal_ans = []\n helper_hash = {}\n\n slices.map do |slice|\n for i in slice\n #make two sets of diagonals for each index currently selected\n #because the number of elements in each diagonal is 4, so there is no center element\n key_num1 = (arr[i-19]*arr[i]*arr[i+21]*arr[i+42])\n key_num2 = (arr[i-38]*arr[i-19]*arr[i]*arr[i+21])\n val_arr1 = [arr[i-19],arr[i],arr[i+21],arr[i+42]]\n val_arr2 = [arr[i-38],arr[i-19],arr[i],arr[i+21]]\n \n #retain the larger of the two possible diagonals for a given element \n key_num1 > key_num2 ? helper_hash[key_num1] = val_arr1 : helper_hash[key_num2] = val_arr2\n \n end\n diagonal_ans = helper_hash.max_by{|k,v| v}\n end\n @@maximums << diagonal_ans\n puts \"Diagonal max is\"\n p diagonal_ans\n\n end", "def diagonal_dirs\n move_set = []\n move_set += grow_unblocked_moves_in_dir(1, -1)\n move_set += grow_unblocked_moves_in_dir(1, 1)\n move_set += grow_unblocked_moves_in_dir(-1, -1)\n move_set += grow_unblocked_moves_in_dir(-1, 1)\n end", "def rDiagonalXY(d, i)\n cr = diagonalColumnRow(d, i)\n {\n 'x' => @width - 1 - cr['column'],\n 'y' => cr['row']\n }\n end", "def moves\n diagonal_dirs\n end", "def sum_of_diagonals\r\n\tresult = []\r\n\tresult.push 1\r\n\twidth = 3\r\n\twhile width <= 1001\r\n\t\tresult.push width**2, width**2 - (width-1), width**2 - (width-1)*2, width**2 - (width-1)*3\r\n\t\twidth += 2\r\n\tend\r\n\treturn result.reduce(:+)\r\nend", "def count_diagonals(x, y)\n total_count = 0\n \n # Upper Left\n if x - 1 >= 0 and y + 1 < $height and $canvas[x - 1][y + 1] == 1 then total_count += 1 end\n # Bottom Left\n if x - 1 >= 0 and y - 1 >= 0 and $canvas[x - 1][y - 1] == 1 then total_count += 1 end\n # Upper Right\n if x + 1 < $width and y + 1 < $height and $canvas[x + 1][y + 1] == 1 then total_count += 1 end\n # Bottom Right\n if x + 1 < $width and y - 1 >= 0 and $canvas[x + 1][y - 1] == 1 then total_count += 1 end\n\n return total_count\nend", "def minor_diagnoal(offset=0)\n\t\tdiag = Array.new()\n\t\tif(offset >= 0)\n\t\t\t0.upto(height-1-offset) {|i| diag.push(self[i][width-1-offset-i])}\n\t\telse\n\t\t\toffset = -offset\n\t\t\toffset.upto(height-1) {|i| diag.push(self[i][width-i+offset-1])}\n\n\t\tend\n\t\n\t\treturn diag\n\tend", "def secondary_diag(pos)\n row, col = pos\n arr = []\n\n until row == 0 || col == @board.length - 1\n row -= 1\n col += 1\n end\n\n while valid_idx?([row, col])\n arr << @board[row][col]\n row += 1\n col -= 1\n end\n\n arr\n end", "def diagonal_c4?\n diagonal_up_c4? || diagonal_down_c4?\n end", "def left_tri(tri)\n\nend", "def diagAve(arr, i, j) # (arr= input, i=0 , j = 0)\n \n nums = [arr[i][j]]\n\n # we iterate through matrix as long as we are inbound\n while (i+1 > 0 && j-1 >= 0)\n\n if (i+1 < arr.length && j-1 < arr[0].length)\n i+=1\n j-=1\n nums.push(arr[i][j])\n else\n break\n end\n end\n\n length = nums.length\n (nums.reduce(:+))/length\nend", "def bottom_right_to_top_left(x1, y1, x2, y2)\n @spiral_array ||= []\n\n # Traversing bottom right to bottom left\n (x2).downto(x1).each do |i|\n @spiral_array << self[y2][i]\n end\n\n # Traversing bottom left to top left\n (y2 - 1).downto(y1).each do |j|\n @spiral_array << self[j][x1]\n end\n\n @spiral_array\n end", "def diagonalDifference(arr)\n n = arr.length\n primary = (0..n - 1).reduce(0) do |sum, i|\n sum + arr[i][i]\n end\n secondary = (0..n - 1).reduce(0) do |sum, i|\n sum + arr[i][n - 1 - i]\n end\n (primary - secondary).abs\nend", "def diagonal_traversal(matrix)\n raise NotImplementedError, \"This method has not yet been implemented\"\nend", "def right_tri(tri)\n\nend", "def diagonals\n [\n Diagonal.new(position: 0,cells: diagonal_cells(diagonal_coordinates[:diagonal_one_coordinates])),\n Diagonal.new(position: 1,cells: diagonal_cells(diagonal_coordinates[:diagonal_two_coordinates]))\n ]\n end", "def diagonal_paths(direction)\n off_gen = DiagonalOffsetGenerator.new(coordinates, direction)\n off_gen.moves\n end", "def check_diagonal2\n cell = @last_cell_played\n count = 1\n while cell.rd && cell.rd.color == cell.color\n cell = cell.rd\n end\n while cell.lu && cell.lu.color == cell.color\n cell = cell.lu\n count += 1\n end\n return true if count >= 4\n false\n end", "def diagonal_difference(arr)\n size = arr.size\n left_diagonal = 0\n right_diagonal = 0\n\n for i in 0..(size - 1)\n left_diagonal += arr[i][i]\n right_diagonal += arr[i][size - i - 1]\n end\n\n (left_diagonal - right_diagonal).abs\nend", "def top_left_to_bottom_right(x1, y1, x2, y2)\n @spiral_array ||= []\n\n # Traversing top left to top right\n (x1..x2).each do |i|\n @spiral_array << self[y1][i]\n end\n\n # Traversing top right to bottom right\n ((y1 + 1)..(y2)).each do |j|\n @spiral_array << self[j][x2]\n end\n\n @spiral_array\n end", "def check_left_diagonal\n if @game_array[0][0] == @game_array[1][1] &&\n @game_array[0][0] == @game_array[2][2] &&\n !@game_array[0][0].nil?\n\n @game_array[0][0]\n end\n end", "def potential_diagonal_moves is_king=false\n moves = []\n\n # Possible moves\n # - all possible combination of increment/decrement of r_idx/c_idx\n\n r_min = is_king ? (r_idx - 1 >= 0 ? r_idx - 1 : r_idx) : 0\n c_min = is_king ? (c_idx - 1 >= 0 ? c_idx - 1 : c_idx) : 0\n r_max = is_king ? (r_idx + 1 <= 7 ? r_idx + 1 : r_idx) : Board::WIDTH - 1\n c_max = is_king ? (c_idx + 1 <= 7 ? c_idx + 1 : c_idx) : Board::WIDTH - 1\n\n # top-right: row-decrement, column-increment [4, 5] [3, 6]\n r = r_idx - 1\n c = c_idx + 1\n while (r >= r_min) && (c <= c_max)\n moves << [r, c]\n r -= 1\n c += 1\n end\n\n # bottom-right: row-increment, column-increment [4, 5] [5, 6]\n r = r_idx + 1\n c = c_idx + 1\n while (r <= r_max) && (c <= c_max)\n moves << [r, c]\n r += 1\n c += 1\n end\n\n # bottom-left: row-increment, column-decrement [4, 5] [5, 4]\n r = r_idx + 1\n c = c_idx - 1\n while (r <= r_max) && (c >= c_min)\n moves << [r, c]\n r += 1\n c -= 1\n end\n\n # top-left: row-decrement, column-decrement [4, 5] [3, 4]\n r = r_idx - 1\n c = c_idx - 1\n while (r >= r_min) && (c >= c_min)\n moves << [r, c]\n r -= 1\n c -= 1\n end\n\n # TODO\n # - refactor to avoid repeated pattern of code without compromising with runtime\n\n moves\n end", "def check_diagonally_left(x, y, numbers_in_product)\n (0...numbers_in_product).inject(1) do |product, i|\n product * matrix[y+i][x-i]\n end\n end", "def check_diagonal1\n cell = @last_cell_played\n count = 1\n while cell.ld && cell.ld.color == cell.color\n cell = cell.ld\n end\n while cell.ru && cell.ru.color == cell.color\n cell = cell.ru\n count += 1\n end\n return true if count >= 4\n false\n end", "def get_diagonal_difference(\n matrix:\n )\n primary_dia, secondary_dia = 0, 0\n array_length = matrix[0].length - 1\n # Calculate diagonal sum\n (0...matrix[0].length).each do |index|\n \tprimary_dia += matrix[index][index]\n \tsecondary_dia += matrix[index][array_length]\n \tarray_length -= 1\n end\n # Return absolute value of the difference between to diagonals\n (primary_dia - secondary_dia).abs\nend", "def diagonalDifference(arr)\n # Write your code here\n d1 = 0\n d2 = 0\n\n (0..arr.length - 1).each do |i|\n d1 = d1 + arr[i][i]\n d2 = d2 + arr[-i-1][i]\n end\n (d1 - d2).abs\nend", "def sum_diagonals(n)\n return n if n <= 1\n 4 * (n**2) - 6 * (n-1) + sum_diagonals(n-2)\nend", "def diagonalSum(matrix)\ntotal = 0\n (0...matrix.length).each {|sub| total += matrix[sub][sub]}\nreturn total\nend", "def diag_abs(mat)\n\tdiag1 = 0\n\tdiag2 = 0\n\t(0..mat.size-1).each do |i|\n \tdiag1 += mat[i][i].to_i\n \tdiag2 += mat[i][mat.size-i-1].to_i\n\tend\n\t(diag1-diag2).abs\nend", "def diagonalDifference(arr)\n\n sum_diagonal_1 = arr.each_with_index.map{|sb_arr, index| sb_arr[index]}.reduce(:+)\n\n sum_diagonal_2 = arr.reverse.each_with_index.map{|sb_arr, index| sb_arr[index]}.reduce(:+)\n\n diff = (sum_diagonal_1 - sum_diagonal_2).abs()\n\n return diff\nend", "def rotate(matrix, start_row, start_col, end_row, end_col, rotations)\n edge = []\n\n # top\n edge.concat start_col.upto(end_col - 1).collect { |c| matrix[start_row][c] }\n # right\n edge.concat start_row.upto(end_row - 1).collect { |r| matrix[r][end_col] }\n # bottom\n edge.concat end_col.downto(start_col + 1).collect { |c| matrix[end_row][c] }\n # left\n edge.concat end_row.downto(start_row + 1).collect { |r| matrix[r][start_col] }\n\n rotated = edge[rotations..-1] + edge[0, rotations]\n\n # top\n i = 0\n start_col.upto(end_col - 1) do |c|\n matrix[start_row][c] = rotated[i]\n i += 1\n end\n\n # right\n start_row.upto(end_row - 1) do |r|\n matrix[r][end_col] = rotated[i]\n i += 1\n end\n\n # bottom\n end_col.downto(start_col + 1) do |c|\n matrix[end_row][c] = rotated[i]\n i += 1\n end\n\n # left\n end_row.downto(start_row + 1) do |r|\n matrix[r][start_col] = rotated[i]\n i += 1\n end\n\n matrix\nend", "def win_diagonal?(mark)\n ltr_diagonal = []\n rtl_diagonal = []\n @grid.each.with_index do |row,r|\n row.each.with_index do |col,c|\n if r == c \n ltr_diagonal << col\n end\n \n if (row.length - r - 1) == c\n rtl_diagonal << col\n end\n end\n end\n ltr = (ltr_diagonal.uniq.length == 1) && ltr_diagonal.include?(mark) \n rtl = (rtl_diagonal.uniq.length == 1) && rtl_diagonal.include?(mark)\n ltr || rtl\n\n end", "def rotate_matrix matrix\n\tlayer = 0\n\tfor layer in 0..(matrix.size / 2).ceil\n\t\tlast = matrix.size - 1 - layer\n\t\tfor i in layer..last-1 # not sure here \n\t\t\toffset = i - layer\n\t\t\ttop = matrix[layer][i]\n\n\t\t\tmatrix[layer][i] = matrix[last - offset ][layer] #7 4\n\n\t\t\tmatrix[last - offset][layer] = matrix[ last ][ last - offset ] #9 8\n\n\t\t\tmatrix[ last ][ last - offset] = matrix[ i ][last ] #3 6\n\n\t\t\t#top -> right\n\t\t\tputs i\n\t\t\tputs last\n\t\t\tmatrix[ i ][ last] = top\n\t\tend\n\tend\n\nend", "def pawn_diagonal?(x,y)\n diagonal?(x, y) && x_diff(x) == 1\n end", "def diagonal_size\n Math.sqrt( @room_height * @room_height + @room_width * @room_width ).round(0)\n end", "def diagonalDifference(a)\n diff = right_diagonal_sum(a) - left_diagonal_sum(a)\n return diff.abs\nend", "def check_right_diagonal\n if @game_array[0][2] == @game_array[1][1] &&\n @game_array[0][2] == @game_array[2][0] &&\n !@game_array[0][2].nil?\n\n @game_array[0][2]\n end\n end", "def all_diagonals(columns)\n diagonals = []\n valid_col_rows = [\n [ [0,2], [1,3], [2,4], [3,5] ],\n [ [0,1], [1,2], [2,3], [3,4], [4,5] ],\n [ [0,0], [1,1], [2,2], [3,3], [4,4], [5,5] ],\n [ [1,0], [2,1], [3,2], [4,3], [5,4], [6,5] ],\n [ [2,0], [3,1], [4,2], [5,3], [6,4] ],\n [ [3,0], [4,1], [5,2], [6,3] ],\n\n [ [0,3], [1,2], [2,1], [3,0] ],\n [ [0,4], [1,3], [2,2], [3,1], [4,0] ],\n [ [0,5], [1,4], [2,3], [3,2], [4,1], [5,0] ],\n [ [1,5], [2,4], [3,3], [4,2], [5,1], [6,0] ],\n [ [2,5], [3,4], [4,3], [5,2], [6,1] ],\n [ [3,5], [4,4], [5,3], [6,2] ],\n ]\n\n valid_col_rows.each do |diag|\n diagonal = ''\n diag.each do |coords|\n symbol = columns[coords.first][coords.last]\n symbol.nil? ? diagonal += '-' : diagonal += symbol\n end\n diagonals << diagonal\n end\n diagonals\n end", "def diagonal_difference(matrix)\n # find first diagonal\n first = []\n i = 0\n j = matrix[i].length-1\n while i < matrix.length\n first << matrix[i][j]\n i += 1 #1\n j -= 1 #1 \n end\n \n sum1 = first.reduce(:+)\n # loop through array of array adjusting for subindex\n second = []\n k = 0\n while k < matrix.length\n second << matrix[k][k]\n k += 1\n end\n \n sum2 = second.reduce(:+)\n \n (sum1-sum2).abs\n \n \n # find second diagonal\n # get abs diff\nend", "def in_descending_diagonal?\n if @board.each_with_index.map {|row, index| row[index]} == @key\n true\n else\n false\n end\n end", "def extent; @bounds.diagonal; end", "def diagonalColumnRow(d, i)\n {\n 'column' => (d.to_i < 0 ? i : d.to_i + i).to_i,\n 'row' => (d.to_i < 0 ? d.to_i.abs + i : i).to_i\n }\n end", "def spiral_iterator\n m = matrix_clone\n result = []\n actions = {\n right: lambda { m.shift },\n down: lambda { m.map { |row| row.pop }},\n left: lambda { m.pop.reverse },\n up: lambda { m.map { |row| row.shift }},\n }\n command_sequence = actions.keys.cycle\n result += actions[command_sequence.next].call until m.empty?\n result\n end" ]
[ "0.73875606", "0.69709074", "0.6918539", "0.68719816", "0.6835893", "0.6742801", "0.6731876", "0.67242265", "0.66501546", "0.6584924", "0.6574043", "0.6550251", "0.6489379", "0.6478272", "0.6477696", "0.64707994", "0.6462538", "0.64564466", "0.6451236", "0.6431176", "0.6428397", "0.64102226", "0.63216513", "0.63154066", "0.6225674", "0.61783725", "0.6133748", "0.6133462", "0.6130701", "0.61271095", "0.61172354", "0.60971856", "0.6062138", "0.6057584", "0.6034375", "0.60211813", "0.6014901", "0.5998343", "0.5975569", "0.59263426", "0.5916829", "0.59166396", "0.59143955", "0.5908899", "0.5907128", "0.58970964", "0.58961856", "0.5892055", "0.58920425", "0.5864065", "0.5852785", "0.5846583", "0.5840046", "0.5825245", "0.57941926", "0.578725", "0.57803696", "0.57762134", "0.5744868", "0.5729812", "0.57294977", "0.5727733", "0.57205296", "0.57179", "0.57150745", "0.5699977", "0.5695958", "0.5693168", "0.5685531", "0.56786764", "0.56721777", "0.5652646", "0.56426394", "0.5640578", "0.56359035", "0.5630214", "0.5610202", "0.5608749", "0.5601059", "0.5587757", "0.5568307", "0.55626225", "0.5536016", "0.55270135", "0.55236137", "0.55204517", "0.5514777", "0.55086106", "0.55007774", "0.5492072", "0.54892594", "0.5478843", "0.54637283", "0.5460097", "0.54385823", "0.54253995", "0.54208416", "0.5412", "0.5411937", "0.5410995" ]
0.5975553
39
destroys spelling analysis records for dirty attributes
def expire_spellcheck_analysis! spellcheck_attributes.each do |attribute| if send("#{attribute}_changed?") spellcheck_analyses.for( attribute ).destroy_all end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_analysis\n model.wordcounts.destroy_all\n create_analysis\n delete_orphaned_keywords\n end", "def destroy_analysis\n model.wordcounts.destroy_all\n delete_orphaned_keywords\n end", "def clean_attributes\n @attribute_changes = {}\n end", "def clean_dirty_attributes!\n @dirty_attribute_keys = []\n end", "def fix_up_controlled_vocabs\n sample_attributes.each do |attribute|\n unless attribute.sample_attribute_type.controlled_vocab?\n attribute.sample_controlled_vocab = nil\n end\n end\n end", "def cleanup_ramfs\n super\n end", "def mark_clean\n @dirty = false\n end", "def _clean; end", "def clean!\n @changes = []\n end", "def clear_changes_information\n @mutations_before_last_save = nil\n forget_attribute_assignments\n @mutations_from_database = nil\n end", "def clean_up\n end", "def clean_up\n end", "def clear_attributes\n @attributes = nil\n end", "def clear_changed_attributes\n\t\t\t \t\t$TRACE.debug 5, \"clear_changed_attributes\"\n\t\t\t \tself.changed_attributes_aado = []\n\t\t\t \tend", "def clean\n tables.clean if tables\n end", "def hard_clean!\n open_db\n @file.truncate(PREAMBLE_SIZE)\n write_fresh_database\n end", "def deverrouiller()\n\t\tself.set_sensitive(true)\n\tend", "def cleanup\n cleanup_nonces\n cleanup_associations\n end", "def clean_up\n if self.deleted?\n # clean room type mapping\n RoomTypeChannelMapping.find_all_by_room_type_id(self.id).each do |rtcm|\n rtcm.update_attribute(:deleted, true)\n end\n # clean master rate mapping\n RoomTypeMasterRateMapping.find_all_by_room_type_id(self.id).each do |rtmr|\n RoomTypeMasterRateChannelMapping.find_all_by_room_type_master_rate_mapping_id(rtmr.id).each do |rtc|\n rtc.update_attribute(:deleted, true)\n end\n rtmr.update_attribute(:deleted, true)\n end\n # clean availability link from\n RoomTypeInventoryLink.find_all_by_room_type_from_id(self.id).each do |rml|\n rml.update_attribute(:deleted, true)\n end\n # clean availability link to\n RoomTypeInventoryLink.find_all_by_room_type_to_id(self.id).each do |rml|\n rml.update_attribute(:deleted, true)\n end\n end\n end", "def clean\n\t\t\n\t\t@db.del 'twitter'\n\t\t@db.del 'rpg'\n\t\n\tend", "def reload\r\n translated_attribute_names.each { |name| @attributes.delete(name.to_s) }\r\n globalize.reset\r\n super\r\n end", "def clean(record)\n return unless record.changed?\n attributes.each do |attribute|\n next unless record.changes[attribute.to_s]\n clean_each(record, attribute)\n end\n end", "def do_remove_from_termination (term)\r\n term.aln_path_id = nil\r\n term.aln_path = nil\r\n term.save\r\n end", "def sanitize_attributes!\n remove_invalid_subjects!\n remove_invalid_audiences!\n remove_invalid_levels!\n set_prices!\n nil\n end", "def clear_translations!\r\n @translation_caches = {}\r\n @stop_merging_translated_attributes = nil\r\n end", "def clear!\n @documents = {}\n @attributes = {}\n @lookup_map = nil\n @all_loaded = false\n @all = []\n end", "def clean_document!\n self.questions.destroy_all\n self.comments.destroy_all\n self.timeline_events().each{|event| event.destroy}\n self.document_items.each{|item| item.timeline_events.destroy_all}\n end", "def clean!; end", "def cleanup_old_person\n\t\tself.person_was.destroy if self.person_was && self.person_was.show_positions.count == 0 && self.person_was.netid.blank?\n\tend", "def clean\n @songs = Songs.clean\n end", "def reset\n ActiveRecord::Base.transaction do\n reset_transcript\n reset_transcript_lines\n reset_transcript_edits\n reset_trasncript_speaker_edits\n end\n end", "def nullify\n criteria.update_all(foreign_key => nil)\n _target.clear do |doc|\n unbind_one(doc)\n doc.changed_attributes.delete(foreign_key)\n end\n end", "def flush_db\n [ 'active_sources', 'data_records', 'semantic_properties', 'semantic_relations', 'workflows'].reverse.each { |f| ActiveRecord::Base.connection.execute \"DELETE FROM #{f}\" }\n # Also remove the \"unsaved cache\" for the wrappers (may be important during testing)\n TaliaCore::SemanticCollectionWrapper.instance_variable_set(:'@unsaved_source_cache', {})\n end", "def clear!\n non_essential = records.all.reject { |r| [\"SOA\", \"NS\"].include? r.type }\n change = update [], non_essential\n change&.wait_until_done!\n end", "def delete_all_attributes\n model = Sketchup.active_model\n model.definitions.each { |d|\n delete_attributes(d.instances)\n }\n dicts = model.attribute_dictionaries\n if dicts\n dicts.delete('MSPhysics')\n dicts.delete('MSPhysics Sounds')\n dicts.delete('MSPhysics Replay')\n end\n end", "def clean\n disable_referential_integrity do\n tables_cache.keys.reverse_each do |table|\n ActiveRecord::Base.connection.execute %(\n DELETE FROM #{table}\n )\n end\n end\n end", "def clean!\n @data = freezer(@data.merge(@dirty))\n @dirty.clear\n self\n end", "def read_auto_clean_up; end", "def reset\n update_attributes(year_of_study: nil,\n faculty_id: nil,\n department_id: nil,\n course_id: nil)\n\n self.uni_modules.each do |uni_module|\n unsave_module(uni_module)\n end\n\n self.pathways.each do |pathway|\n self.pathways.delete(pathway)\n end\n end", "def clean\n self.dup.clean!\n end", "def clear_attributes\n self.attribute_names.clear\n self.public_attribute_names.clear\n self.protected_attribute_names.clear\n\n true\n end", "def data_cleansing_attribute_cleaners\n @data_cleansing_attribute_cleaners ||= Concurrent::Hash.new\n end", "def clear_audit_attributes\n all_audit_attributes.each do |attribute_name|\n if respond_to?(attribute_name) && respond_to?(\"#{ attribute_name }=\")\n write_attribute(attribute_name, nil)\n end\n end\n\n @changed_attributes = changed_attributes.reduce(ActiveSupport::HashWithIndifferentAccess.new) do |result, (key, value)|\n unless all_audit_attributes.include?(key.to_sym)\n result[key] = value\n end\n\n result\n end\n end", "def clean\n end", "def clean_attributes\n attributes.delete(:bare_metal)\n attributes.delete(:flavor_id)\n attributes.delete(:ephemeral_storage)\n end", "def fix_scoped_courses\n ScopedCourse.find_each do |scoped_course|\n puts 'SC[%03d]' % [ scoped_course.id ]\n acbcc = AbstractCourse.where( code: scoped_course.course_code ).first\n if acbcc.nil?\n puts ' - cleaning .abstract_course'\n scoped_course.abstract_course = nil\n scoped_course.save\n end\n end\n end", "def cleanup!\n # This method may be left unimplemented if that is applicable\n end", "def delete_useless!\n @eng_sentence = @eng_sentence - @useless_eng_words\n @rus_sentence = @rus_sentence - @useless_rus_words\n end", "def invalidate_memoized_attributes\n @full_name = nil\n @cache_file = nil\n end", "def clean_raw_data(klass)\n\t\tputs \"Deleting all #{klass.name} records\"\n\t\tklass.delete_all\n\tend", "def remove_all_raws!\n @raws = {}\n end", "def update_attributes!(attributes)\n super(mark_for_destruction(attributes))\n end", "def teardown\n super\n delete_goo_models(LinkedData::Models::Review.all)\n delete_goo_models(LinkedData::Models::Ontology.all)\n delete_goo_models(LinkedData::Models::User.all)\n @review_params = nil\n @user = nil\n @ont = nil\n end", "def reset_temporal\n\t\ttemp = self.temporal\n\t\ttemp.links.delete_all\n\t\ttemp.keywords.delete_all\n\t\ttemp.parameters = nil\n\t\ttemp.save\n\tend", "def complete_removal(manual_record)\n document_ids = document_ids_for(manual_record)\n\n document_ids.each do |id|\n SpecialistDocumentEdition.where(document_id: id).map(&:destroy)\n end\n\n manual_record.destroy\n\n log \"Manual destroyed.\"\n log \"--------------------------------------------------------\"\n end", "def clear_garbage\n self.tmp_garbage.each do |relation, record|\n if record.is_a? Array\n record.each { |r| r.destroy }\n else\n record.destroy\n end\n end if self.tmp_garbage.present?\n self.tmp_garbage = {}\n end", "def cleanup\n datas[:model_feature_values].each_pair { |model_key, feature_values| \n model = Model.find(model_key)\n feature_keys = []\n model.features_list { |feature| feature_keys << feature.key }\n values(model).delete_if { |feature_key, value| !feature_keys.include?(feature_key) }\n }\n end", "def persist\n prepare do\n document.attributes.delete(field)\n execute(\"$unset\")\n end\n end", "def cleanup!; end", "def cleanup!; end", "def clean_all_tags\n self.tags.destroy_all\n self.countries.destroy_all\n self.requirements.destroy_all\n self.places.destroy_all\n end", "def cleanup\n end", "def cleanup\n end", "def cleanup; end", "def cleanup; end", "def cleanup; end", "def cleanup; end", "def clean_bad_data\n self.character_achievements.select{|ca| ca.achievement }.group_by{|ca| ca.achievement.armory_id }.each{|aid, cas|\n if cas.size > 1\n cas[1,1000].each{|c| c.destroy }\n end\n }\n end", "def clean_cache_and_translations\n $redis.srem(\"otwtranslation_rules_for_#{language_short}\", display_type)\n\n Otwtranslation::Translation.for_language(language_short)\n .where(\"rules != '#{[].to_yaml}'\").each do |translation|\n if translation.rules.include?(id)\n translation.approved = false\n translation.rules = []\n translation.save!\n end\n end\n end", "def partially_valid_clear\n @partially_valid_attributes = []\n end", "def cleanup\n end", "def cleanup\n end", "def cleanup\n end", "def clean_refill dirty_atts\n # TODO\n end", "def clean; status[:normal]; end", "def mark_for_destruction(attributes)\n self.class.embeddings.each do |embed|\n if attributes[embed]\n updates = attributes[embed].map { |model| model[:id] }.compact\n destroy = updates.empty? ? send(\"_super_#{embed}\".to_sym).select(:id) : send(\"_super_#{embed}\".to_sym).select(:id).where('id NOT IN (?)', updates)\n destroy.each { |model| attributes[embed] << { :id => model.id, :_destroy => '1' } }\n end\n end\n\n attributes\n end", "def cleanup\n end", "def cleanup\n end", "def cleanup\n end", "def cleanup\n end", "def clean_db\n\n puts \"Caching wikipedia links\"\n @wikipedia_cache = {}\n Artist.all\n .where('wikilink IS NOT NULL')\n .pluck( 'name' , 'wikilink' )\n .each { |result| @wikipedia_cache[ key_name(result[0]) ] = result[1] }\n\n puts \"Cleaning db\"\n PlayerState.delete_all\n PlayListSong.delete_all\n Song.delete_all\n Album.delete_all\n Artist.delete_all\n end", "def clean(_name)\n @rules.delete(_name)\n end", "def cleanup\r\n end", "def clear_aliased_actions\n @aliased_actions = {}\n end", "def clear_model\n class_eval do\n # Remove event models\n events.each_key do |ev_symbol|\n remove_const ev_symbol.to_s.camelcase(:upper)\n end\n\n [@events, @signal_sets, @forwarding_sets, @causal_link_sets,\n @arguments, @handler_sets, @precondition_sets].each do |set|\n set&.clear\n end\n end\n super\n end", "def clear_tables\n # the order of operations here is important because of the foreign key constraint\n MinWords::DB.drop_table :defines, :words\n create_tables\n end", "def clean_up\n @minefield = nil\n end", "def clear_attributes_and_errors\n attributes.each do |attribute|\n subject.send(\"#{attribute}=\", nil)\n end\n subject.errors.clear\n end", "def changes_applied\n super\n @embedded_in_portal = nil\n @marked_for_destruction = nil\n end", "def update_attributes(attributes)\n super(mark_for_destruction(attributes))\n end", "def finalize\n @entities.clear\n end", "def reset!\n self.words_for_last = []\n self.corpus_dfs = {}\n self.block_list = []\n self.single_block = []\n end", "def discardAllTreasures\n \n end", "def clear_timestamp_attributes\n all_timestamp_attributes_in_model.each do |attribute_name|\n self[attribute_name] = nil\n clear_attribute_change(attribute_name)\n end\n end", "def action_after_save\n @content = nil\n @ng_xml = nil\n remove_instance_variable(:@ng_xml)\n end", "def clear_changes!\n remove_instance_variable(:@original_hash) if defined?(@original_hash)\n end", "def reset_dirty_flag\n\t\t@dirty = false\n\tend", "def clean_all\n self.clean(@objects.keys)\n end", "def cleanup\n @models.reverse_each(&:destroy_all)\n end", "def cleanup\n self.city = capwords(city) if (attribute_present?('city') && (self.city != nil))\n self.state = state.upcase if (attribute_present?('state') && (self.state != nil))\n self.street = street.split(\" \").map{|x| x.capitalize}.join(\" \") if (attribute_present?('street') && (street != nil))\n self.street_2 = street_2.split(\" \").map{|x| x.capitalize}.join(\" \") if (attribute_present?('street_2') && (street_2 != nil))\n self.phone = phone.split(\"-\").join(\"\").split(\".\").join(\"\") if (attribute_present?('phone') && (phone != nil))\n self.first_name = capwords(first_name) if (attribute_present?('first_name') && (first_name != nil))\n self.last_name = capwords(last_name) if (attribute_present?('last_name') && (last_name != nil))\n end" ]
[ "0.7054716", "0.6836037", "0.67611176", "0.66816026", "0.65128964", "0.64335", "0.6398209", "0.6332102", "0.6327789", "0.63066363", "0.6243849", "0.6243849", "0.6214917", "0.6196193", "0.6184995", "0.60894126", "0.6087792", "0.60426253", "0.6020794", "0.6009847", "0.5996206", "0.5996085", "0.5993783", "0.5960221", "0.5948766", "0.5926101", "0.5925759", "0.5920172", "0.59173983", "0.5908805", "0.58893657", "0.5885211", "0.5881412", "0.5877173", "0.5865939", "0.586392", "0.5851357", "0.58328277", "0.5828475", "0.580459", "0.5782733", "0.5778107", "0.5774048", "0.57720554", "0.5765747", "0.5748351", "0.57365495", "0.57277864", "0.5716487", "0.57138884", "0.57046896", "0.5697353", "0.56862146", "0.56861025", "0.5678382", "0.5676791", "0.5668829", "0.5666519", "0.56657857", "0.56657857", "0.5664561", "0.5660197", "0.5660197", "0.5659479", "0.5659479", "0.5659479", "0.5659479", "0.5654215", "0.5652857", "0.5648039", "0.56477123", "0.56477123", "0.56477123", "0.5645265", "0.5643776", "0.5641787", "0.5638089", "0.5638089", "0.5638089", "0.5638089", "0.56354773", "0.5632956", "0.563102", "0.5630381", "0.56299555", "0.562659", "0.5618212", "0.5616185", "0.56045806", "0.55949146", "0.5594516", "0.55847245", "0.5582461", "0.5578014", "0.5575575", "0.55740255", "0.557318", "0.55553204", "0.5551178", "0.5537977" ]
0.7698176
0
schedules a spellcheck analysis if there's any attribute missing without analysis
def schedule_spellcheck_analysis! if missing_spellcheck_analysis? self.class.delay.perform_spellcheck!(id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analyse!\n @words = formatted_mispelled_words\n @success = true\n rescue *rescued_exceptions_keys => e\n @success = false\n if rescued_exceptions_messages.include?(e.message)\n # aspell is not present. track analysis as failure\n else\n raise e\n end\n end", "def expire_spellcheck_analysis!\n spellcheck_attributes.each do |attribute|\n if send(\"#{attribute}_changed?\")\n spellcheck_analyses.for(\n attribute\n ).destroy_all\n end\n end\n end", "def check_for_definitions\n @words.each do |word|\n @lemma ? lemma = \" - #{@lemmas[word]}\" : lemma = \"\"\n\n # Strip characters - mimics trimWordLowerCase in texts.js\n regex = /[\\u200B-\\u200D\\uFEFF\\u00A0]/\n word.gsub!(regex, \"\")\n regex = /^[.,!¡?¿:;\\/|\\\\'\"“”‘’‚„«»‹›()\\[\\]\\-_]+|[.,!¡?¿:;\\/|\\\\'\"“”‘’‚„«»‹›()\\[\\]\\-_]+$/\n word.gsub!(regex, \"\")\n \n next if word.length == 0\n \n # Convert to lowercase\n word = word.mb_chars.downcase.to_s\n current_word = word\n \n while word.length > 0 do\n if Match.find_by_word_and_text_id(word, @text)\n break\n else\n if word.length == 1\n @missing.push(\"#{current_word}#{lemma}\")\n break\n else\n if word.last == \"*\"\n word.chomp!(\"*\") # Remove wildcard character, if present\n word = word[0..-2] # Remove last character\n end\n word << \"*\" # Add wildcard character\n end\n end\n end\n end\n end", "def spellcheck\n lines = ::File.open(@file_path).readlines\n lines.each_with_index do |line, line_index|\n check_line(line, line_index + 1)\n end\n @incorrect_words\n end", "def load_necessary_words\n necessary_words = []\n\n necessary_spellings.each do |spelling|\n if @table.key?(spelling)\n necessary_words << @table[spelling]\n else\n $stderr.puts \"Warning! #{spelling} is a necessary word but it is not in the corpus.\"\n end\n end\n\n necessary_words\n end", "def check_against_bad_word_list(attrs_to_check)\n attrs_to_check.each do |attribute|\n check = check_bad_word_list(attribute)\n model.errors.add(attribute, I18n.translate('activerecord.errors.messages')[check]) unless check.nil?\n end\n end", "def precheck\n end", "def spell_check\n #Temp has to get around iterating blocking hash editing\n temp_hash = Hash.new\n #For each word hash pair\n $words.each do |word|\n #Sets values for lexicon reading\n first_char = word[0][0]\n len = word[0].length\n\n #Searches lexicon for match, default is false\n match = false\n #For each word in the lexicon with the same first and second characters checks for equality\n $lexicon[first_char][len].each do |check|\n #If the words are the same sets spelling to true, or correct and breaks out of loop\n if check[0] == word[0]\n match = true\n break;\n end\n end\n #Sets temp hash to proper values, to be reassigned to word hash after full iterations\n temp_hash[word[0]] = match\n end\n #Sets words hash with proper values\n temp_hash.each do |temp|\n $words[temp[0]] = temp[1]\n end\nend", "def auto_analyze=(_arg0); end", "def auto_analyze; end", "def check(node)\n alignment_node = alignment_node(node)\n return if alignment_node.nil?\n\n alignment_loc = alignment_location(alignment_node)\n kw_loc = node.loc.keyword\n\n return if alignment_loc.column == kw_loc.column || alignment_loc.line == kw_loc.line\n\n add_offense(\n kw_loc, message: format_message(alignment_node, alignment_loc, kw_loc)\n ) do |corrector|\n autocorrect(corrector, node, alignment_loc)\n end\n end", "def run_warned; end", "def mispelled_words\n Spellchecker.check(@text, LANG).reject do |word|\n word[:correct]\n end\n end", "def spellcheck(line)\n line.gsub!(/\\r/n,'')\n line.gsub!(/\\s+/n, ' ')\n results = to_ispell(line)\n results.collect do |line|\n tokens = line.split(/,?:?\\s+/n)\n res = Result.new\n res.type = Result::TYPES[tokens.shift]\n case res.type\n when :root\n res.root = tokens.shift\n when :none\n res.original = tokens.shift\n res.offset = tokens.shift\n when :miss, :guess\n res.original = tokens.shift\n res.count = tokens.shift\n res.offset = tokens.shift\n res.guesses = tokens\n end\n res.freeze!\n end\n end", "def check_spelling(files = nil)\n # Installs my fork of the spell checker if needed\n # my fork has line numbers + indexes\n system \"npm install -g orta/node-markdown-spellcheck\" unless mdspell_installed?\n\n # Check that this is in the user's PATH after installing\n raise \"mdspell is not in the user's PATH, or it failed to install\" unless mdspell_installed?\n\n markdown_files = get_files files\n\n arguments = [\"-r\"]\n skip_words = ignored_words || []\n\n arguments.push(\"-n\") if ignore_numbers\n arguments.push(\"-a\") if ignore_acronyms\n arguments.push(\"--#{language}\")\n\n File.write(\".spelling\", skip_words.join(\"\\n\"))\n result_texts = Hash[markdown_files.to_a.uniq.collect { |md| [md, `mdspell #{md} #{arguments.join(\" \")}`.strip] }]\n spell_issues = result_texts.select { |path, output| output.include? \"spelling errors found\" }\n File.unlink(\".spelling\")\n\n # Get some metadata about the local setup\n current_slug = env.ci_source.repo_slug\n\n if spell_issues.count > 0\n message = \"### Spell Checker found issues\\n\\n\"\n spell_issues.each do |path, output|\n if defined? @dangerfile.github\n git_loc = \"/#{current_slug}/tree/#{github.branch_for_head}/#{path}\"\n elsif defined? @dangerfile.gitlab\n git_loc = \"/#{current_slug}/tree/#{gitlab.branch_for_head}/#{path}\"\n else\n raise \"This plugin does not yet support bitbucket, would love PRs: https://github.com/dbgrandi/danger-prose/\"\n end\n\n message << \"#### [#{path}](#{git_loc})\\n\\n\"\n\n message << \"Line | Typo |\\n\"\n message << \"| --- | ------ |\\n\"\n\n output.lines[1..-3].each do |line|\n index_info = line.strip.split(\"|\").first\n index_line, index = index_info.split(\":\").map { |n| n.to_i }\n\n file = File.read(path)\n\n unknown_word = file[index..-1].split(\" \").first\n\n error_text = line.strip.split(\"|\")[1..-1].join(\"|\").strip\n error = error_text.gsub(unknown_word, \"**\" + unknown_word + \"**\")\n\n message << \"#{index_line} | #{error} | \\n\"\n end\n markdown message\n end\n end\n end", "def spell; end", "def checks; end", "def run_checks\n methods.keep_if { |m| m.match(/^check_/) }.each do |check|\n send check.to_sym unless @skip.include? check.to_s.sub 'check_', ''\n end\n end", "def to_check file_to_check\n #Opens the file to check\n file = File.open(file_to_check, 'r')\n #Reads until the end of the file\n until file.eof?\n #For each line check the spelling of each word\n file.each_line do |line|\n line.chomp!.downcase!\n #cleans punctuation\n line.gsub!($remove_punctuation, \"\")\n #Removes numbers since they can't be spelled wrong\n line.gsub!(/\\d/, \"\")\n line.split.each do |word|\n $words[word] = false\n end\n end\n end\nend", "def feedback\n puts \"Spelling errors\"\n #Default errors is 0\n errors = 0\n #For each word in the word hash\n $words.each do |word|\n #If the word is spelled wrong prints the word and increments errors\n if word[1] == false\n puts \"#{word[0]}\"\n errors += 1\n end\n end\n #If there are no errors states as much\n if errors == 0\n puts \"No errors found\"\n end\nend", "def run\n load_the_file\n word_frequency\n match_the_word\n end", "def completed_text_extraction\n @found_completed_text_extraction = true\n end", "def apply(name)\n load_knowledge_base if @checks.nil?\n return false if @checks.empty?\n\n @checks.each do |check|\n if check.name == name\n unless ((check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK || check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK ) && @name == \"Gemfile.lock\")\n debug_me \"applying check #{check.name}\" \n @applied_checks += 1\n @applied << { :name=>name }\n check.ruby_version = @ruby_version[:version]\n check.detected_ruby = @ruby_version if check.kind == Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK\n check.dependencies = self.connected_gems if check.kind == Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK\n check.root_dir = self.target if check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK\n check.options = {:detected_ruby => self.ruby_version, :dependencies => self.connected_gems, :root_dir => self.target } if check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK\n\n check_vuln = check.vuln?\n\n @vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>nil} if check_vuln && check.kind != Codesake::Dawn::KnowledgeBase::COMBO_CHECK\n\n @vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>check.vulnerable_checks} if check_vuln && check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK\n\n @mitigated_issues << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>nil} if check.mitigated?\n return true\n else\n debug_me \"skipping check #{check.name}\"\n @skipped_checks += 1\n end\n end\n end\n\n false\n end", "def apply(name)\n load_knowledge_base if @checks.nil?\n return false if @checks.empty?\n\n @checks.each do |check|\n if check.name == name\n @applied << { :name=>name }\n check.ruby_version = @ruby_version[:version]\n check.detected_ruby = @ruby_version if check.kind == Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK\n check.dependencies = self.connected_gems if check.kind == Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK\n check.root_dir = self.target if check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK\n check.options = {:detected_ruby => self.ruby_version, :dependencies => self.connected_gems, :root_dir => self.target } if check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK\n\n check_vuln = check.vuln?\n\n @vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>nil} if check_vuln && check.kind != Codesake::Dawn::KnowledgeBase::COMBO_CHECK\n\n @vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>check.vulnerable_checks} if check_vuln && check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK\n\n @mitigated_issues << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>nil} if check.mitigated?\n return true\n end\n end\n\n false\n end", "def necessary_spellings\n spellings = []\n if necessary_file\n File.readlines(necessary_file).each do |line|\n line.strip!\n spellings << line unless line == \"\"\n end\n end\n spellings\n end", "def process_atb \n while @active_battler == nil\n process_forced_action\n for battler in tactics_all\n battler.check_casting\n end\n return if @using_skill\n @use_spell = next_wait_skill(tactics_all) \n return unless @use_spell.empty?\n next_battler = next_atb_battler(tactics_all)\n if next_battler\n next_battler.reset_atb\n set_active_battler(next_battler)\n return\n else \n update_atb(tactics_all)\n end\n end\n end", "def force_analysis\n false\n end", "def force_analysis\n false\n end", "def check_starting(_lang_result)\n end", "def summoner_spell; end", "def word_present?(word)\n @spellchecker.spellcheck(word)\n end", "def spell_check_all(text_arr)\n\t\tcheck_arr = []\n\t\tchecked_text = []\n\n\t\ttext_arr.each do |word|\n\t\t\tif ender?(word)\n\t\t\t\tcheck_arr << true\n\t\t\telse\n\t\t\t\tcheck_arr << Hunspell.check?(word)\n\t\t\tend\n\t\tend\n\n\t\tcheck_arr.each_with_index do |bool, i|\n\t\t\tif bool\n\t\t\t\tchecked_text << text_arr[i]\n\t\t\telse\n\t\t\t\tchecked_text << {original: text_arr[i],\n\t\t\t\t\t\t\t\t\t\t\t\t suggests: Hunspell.suggest(text_arr[i])}\n\t\t\tend\n\t\tend\n\t\treturn checked_text\n\tend", "def validate_pre_run!\n check_if_yml_present!\n check_if_yml_has_correct_content!\n check_if_rubocop_command_exists!\n end", "def valid_skill\n @windows[Win_Help].move_to(2)\n @active_battler.current_action.set_skill(@spell.id)\n @targets = get_targets\n if @ATB_Active and \n GTBS::USE_WAIT_SKILLS and GTBS::ALLOW_SKILL_TARGET and \n GTBS::skill_wait(@spell.id)[0] > 0\n occ = occupied_by?(@cursor.x, @cursor.y)\n if occ and !occ.dead? \n type = Command_Confirm::Wait_Skill_Targeting\n end\n Sound.play_decision\n @cursor.active = false\n #Do immediat skill if type == nil\n @windows[Win_Confirm].ask(Command_Confirm::Skill, type)\n @windows[Win_Status].dmg_preview(2, @active_battler, @spell, @targets)\n \n elsif @targets.size >0 #unless targets 0 or less for some reason\n #make summons miss when cell is occupied\n if (GTBS::is_summon?(@spell.id, @active_battler.is_a?(Game_Actor))> 0 && occupied_by?(@cursor.x, @cursor.y)!= nil) or \n (@spell.for_opponent? && (@selected == @active_battler && !GTBS::ATTACK_ALLIES) &&\n !@active_battler.skill_range(@spell.id)[3] )\n Sound.play_buzzer\n else\n Sound.play_decision\n @cursor.active = false \n @windows[Win_Confirm].ask(Command_Confirm::Skill)\n @windows[Win_Status].dmg_preview(2, @active_battler, @spell, @targets)\n end\n \n elsif GTBS::is_summon?(@spell.id, @active_battler.is_a?(Game_Actor))>0 and $game_map.passable?(@cursor.x, @cursor.y, 0)\n Sound.play_decision\n @cursor.active = false \n @windows[Win_Confirm].ask(Command_Confirm::Skill)\n @windows[Win_Status].dmg_preview(2, @active_battler, @spell, @targets)\n \n elsif (!$game_system.actors_bodies? || GTBS::REVIVE_ANY_DEAD) and \n @spell.for_dead_friend? and occupied_by?(@cursor.x, @cursor.y) == nil\n open_revive_window\n \n else\n #Unauthorized validation\n Sound.play_buzzer\n end\n end", "def check_correct_spellings(review_text_array)\n speller = FFI::Aspell::Speller.new('en_US')\n # speller.suggestion_mode = Aspell::NORMAL\n\n review_text_array_temp = []\n\n # iterate through each response\n review_text_array.each do |review_text|\n review_tokens = review_text.split(\" \")\n review_text_temp = \"\"\n\n # iterate through tokens from each response\n review_tokens.each do |review_tok|\n # check the stem word's spelling for correctness\n unless speller.correct?(review_tok)\n review_tok = speller.suggestions(review_tok).first unless speller.suggestions(review_tok).first\n end\n\n review_text_temp += \" \"\n review_text_temp += review_tok.downcase\n end\n\n review_text_array_temp << review_text_temp\n end\n\n return review_text_array_temp\n end", "def spelling_hot? options\n if spelling_matters\n !events.where(body: Regexp.new(options[:input], \"i\")).any?\n else\n !is_hit_by_any?\n end\n end", "def should_show_spellcheck_suggestions? response\n response.total <= spell_check_max &&\n !response.spelling.nil? &&\n response.spelling.words.any?\n end", "def run\n searching if @nr_of_words >= @phrase_length\n end", "def setup_skill_wait\n if !GTBS::ALLOW_SKILL_TARGET\n target = nil\n elsif t = occupied_by?\n target = [t,[0, 0]]\n elsif t = @cursor.targeted_battlers.first\n offset_x = @cursor.x-t.x\n offset_y = @cursor.y-t.y\n else\n target = nil\n end\n @active_battler.skill_cast = [@spell, @cursor.pos, target]\n @active_battler.setup_skill\n @active_battler.count_skill_usage(@spell)\n @spell = nil\n end", "def update_analysis\n model.wordcounts.destroy_all\n create_analysis\n delete_orphaned_keywords\n end", "def apply(name)\n load_knowledge_base if @checks.nil?\n return false if @checks.empty?\n\n @checks.each do |check|\n if check.name == name\n @applied << { :name=>name }\n check.ruby_version = self.ruby_version[:version]\n check.detected_ruby = self.ruby_version if check.kind == Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK\n check.dependencies = self.connected_gems if check.kind == Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK\n check.root_dir = self.target if check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK\n @vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences} if check.vuln?\n @mitigated_issues << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences} if check.mitigated?\n return true\n end\n end\n\n false\n end", "def run\n content_at_file = @file_to_validate\n outcome = no_subtitle_marks_followed_by_space?(content_at_file)\n log_and_report_validation_step(outcome.errors, outcome.warnings)\n end", "def start # :nodoc:\n run_corpus\n run_matchers\n save_unmatched_words\n find_event if @matches[:event].empty?\n @matches\n end", "def spells()\n learnings = self.learnings()\n spells = learnings.map { |learning| learning.spell }\n return spells\n end", "def corrections\n #For each word to be looked at\n $words.each do |word_array|\n #If the word is misspelled attempt corrections\n possible_matches = Array.new\n if word_array[1] == false\n #Sets word to the actual word, instead of array pair\n word = word_array[0]\n # Get lexicon searching vars\n first_char = word[0]\n len = word.length\n\n ##Find words with similar letters\n #Saves the length of the word for eaiser access\n size = word.length\n #Iterates over words with matching starting letter and length +- 1\n $lexicon[first_char][len].each do |word_compare|\n possible_matches << word_compare[0]\n end\n\n # only check shorter words if length is greater than 1\n if len > 1\n $lexicon[first_char][len-1].each do |word_compare|\n possible_matches << word_compare[0]\n end\n end\n\n $lexicon[first_char][len+1].each do |word_compare|\n possible_matches << word_compare[0]\n end\n\n #Iterate over the possible matches, taking the match with the highest percentage\n #Hash to hold similarity\n similarity = Hash.new(0.0)\n possible_matches.each do |word_to_compare|\n similarity[word_to_compare] = match_percentage word, word_to_compare\n end\n\n best_match = ''\n similarity.each do |match|\n if match[1] > similarity[best_match]\n best_match = match[0]\n end\n end\n $correction[word] = best_match\n end\n end\nend", "def ai_atk_spell\n opponent_id = @opponents_indexes[@ai_opponent_id]\n opponent = @opponents[opponent_id]\n\n matched_path_way = opponent.units_at_front 40\n\n unless matched_path_way.nil?\n position, matches = matched_path_way\n\n spell_uid = @ai_preset[:atk_spell].sample\n if matches > 2\n ai_cast_spell(@ai_opponent_id, 1.0 - position, spell_uid)\n end\n end\n end", "def can_cast_spell?(name)\n return false unless spell = find_spell(name)\n spell.cost <= self.mana && !active_effects_collide?(spell)\n end", "def not_timed_and_scanned\n msg = I18n.t('activerecord.errors.models.assignment_properties.attributes.is_timed.not_scanned')\n errors.add(:base, msg) if is_timed && scanned_exam\n end", "def analyze\n analyze_text\n @analyzed = true\n nil\n end", "def perform_analysis(faids)\n @checker = Checker.new(schematron, self)\n faids.each do |faid|\n faid = faid.current if faid.is_a? FindingAid\n ActiveRecord::Base.transaction do\n @checker.check(faid).each_slice(1000) do |batch|\n ConcreteIssue.insert_all(batch)\n end\n self.finding_aid_versions << faid\n self.increment! :eads_processed\n end\n end\n end", "def validate(model)\n # tree iterate the model, and call the checks for each element\n\n # While not strictly needed, here a check is made of the root (the \"Program\" AST object)\n check_bad_word(model)\n\n # Then check all of its content\n model.eAllContents.each {|m| check_bad_word(m) }\n @acceptor\n end", "def after_lint; end", "def perform\n # Get unprocessed tweets\n options = { is_processed: false }\n tweets = RawTweet.where(options)\n unless tweets.nil?\n tweets.each do |tweet|\n if valid?(tweet.full_text)\n save_event(prep_event(tweet))\n end\n update_tweet(tweet.id)\n end\n end\n rescue NoMethodError => e\n puts e\n end", "def test_a\n fdl_test( %{\n feature test\n (not all(x,x:[word=nil]))\n <x.id>},\n false)\n end", "def match_words_yandex\n eng_size= @eng_sentence.length - 1\n collision= false\n updated= false\n\n (0..eng_size).each { |eng_index|\n if !@used_eng[eng_index]\n eng_word= @eng_sentence[eng_index]\n translations= @all_translations[eng_word]\n rus_indexes= []\n translations.each do |translation|\n rus_indexes+= matches_infinitives(translation)\n end\n rus_indexes.uniq!\n if rus_indexes.size == 1\n updated= true\n @used_eng[eng_index]= true\n @used_rus[rus_indexes[0].rus_index]= true\n @translation_eng_to_rus[eng_index]= rus_indexes[0].translation\n else\n collision|= rus_indexes.size > 1\n end\n end\n }\n\n if collision && updated\n match_words_yandex\n end\n end", "def analyze\n # First, update build if necessary\n build\n Dir.chdir @build_dir\n spawn_cmd \"run-clang-tidy -p '#{@proj_dir}/#{@build_dir}' -header-filter='\\.hpp'\"\n Dir.chdir @proj_dir\n end", "def check_line(line, line_number)\n line_words = self.class.word_splitter(line)\n line_words.each do |word|\n word_is_right, spell_checked_word = check_word(word, line_number)\n next if word_is_right.is_a?(TrueClass)\n @incorrect_words << spell_checked_word\n end\n end", "def check_dist(cli)\n p = cli.load_project\n %i[ani aai].each do |dist|\n res = p.result(\"#{dist}_distances\")\n next if res.nil?\n\n cli.say \"Checking #{dist} table for consistent datasets\"\n notok, fix = check_dist_eval(cli, p, res)\n check_dist_fix(cli, p, fix)\n check_dist_recompute(cli, res, notok)\n end\n end", "def all_valid \n h = @horizontal.reject { |(x,y),r| x==r }\n v = @vertical.reject { |(x,y),r| y==r }\n\n words = h.map { |position,right|\n x,y = position\n (x..right).map { |x| @board.tile_at([x,y]) }\n }\n words.concat v.map {|position, bottom|\n x,y = position\n (y..bottom).map { |y| @board.tile_at([x,y]) }\n }\n\n FFI::Hunspell.dict do |dict|\n for word in words do\n word = (word.map {|tile| tile.letter}).join.downcase\n return false unless dict.check? word\n end\n end\n return true\n end", "def perform(*args)\n # puts \"STARTING SENTIMENT ANALYSIS\"\n # Mention.where(sentiment_set: false).where('created_at > ?', Time.now.utc - 10.minutes).each do |mention|\n # if mention.comment\n # mention.update(sentiment: Sentimentalizer.analyze(mention.comment).overall_probability, sentiment_set: true)\n # end\n # end\n # puts \"DONE SENTIMENT ANALYSIS\"\n end", "def test_load_dictionaries\n spellchecker = AlfonsoX::SpellChecker::Main.from_config(\"#{RESOURCES_PATH}/config.yml\")\n assert_equal 6, spellchecker.dictionaries.length\n\n word_list_file_dictionary = spellchecker.dictionaries[3]\n word_list_dictionary = spellchecker.dictionaries[4]\n\n assert word_list_file_dictionary.is_a?(AlfonsoX::SpellChecker::Dictionary::WordListFile)\n assert_equal 59, word_list_file_dictionary.words.length\n assert word_list_dictionary.is_a?(AlfonsoX::SpellChecker::Dictionary::WordList)\n assert_equal 4, word_list_dictionary.words.length\n end", "def lookup_method name\n found = load_methods_matching name\n\n if found.empty?\n if check_did_you_mean\n methods = []\n _, _, method_name = parse_name name\n find_methods name do |store, klass, ancestor, types, method|\n methods.push(*store.class_methods[klass]) if [:class, :both].include? types\n methods.push(*store.instance_methods[klass]) if [:instance, :both].include? types\n end\n methods = methods.uniq\n suggestions = DidYouMean::SpellChecker.new(dictionary: methods).correct(method_name)\n raise NotFoundError.new(name, suggestions)\n else\n raise NotFoundError, name\n end\n end\n\n filter_methods found, name\n end", "def valid_words(rack)\n # Load the words\n list_of_words = load_words\n array_of_valid_words = []\n # for each word check if all the letters of word are in rack\n list_of_words.each do |word|\n array_of_valid_words << word if check_word(word, rack)\n end\n array_of_valid_words\nend", "def calculate\n candidates = []\n\n generalized_cause = NLU::Generalization.new(symbols: @symbols).generalize(@cause)\n\n #ap \"sentence: #{cause_sentence}\"\n #ap \"learned: #{@learned.inspect}\"\n\n # We go through everything that was learned before\n @learned.each do |function_name, criteria|\n criteria[:generalizations].each do |generalization|\n\n # We generate a pre-candidate for this generalization. It starts\n # with score zero because we don't know yet whether this criteria\n # fits the sentence or not.\n local_candidate = {\n fn: function_name,\n attrs: { },\n score: 0.0\n }\n\n #ap \"generalized_cause #{generalized_cause}\"\n\n # We then generalize the cause sentence and go through it.\n # We will match *each* learned generalization against the cause\n # generalization.\n generalized_cause.each_with_index do |cause_rule, cause_index|\n\n\n # Wildcard\n #\n # Matches these:\n #\n # > i want a [type:wildcard:some_name_for_this_wildcard]\n # > i want a ford\n #\n wildcard = \"[#{NLU::Generalization::RESERVED_TYPES[:wildcard]}]\"\n #ap \"wildcard: #{wildcard}\"\n wildcard_regex = Regexp.escape(wildcard)\n if generalization =~ /wildcard/i\n wildcard_generalization = generalization\n .gsub(/\\[(type:wildcard)(.+)\\]/i, '[\\1]')\n end\n #ap \"wildcard_generalization(#{wildcard_generalization}) =~ cause_rule(#{wildcard_regex})\"\n if wildcard_generalization.to_s =~ Regexp.new(wildcard_regex, Regexp::IGNORECASE)\n #ap \"true -> #{wildcard_generalization} =~ /#{Regexp.new(wildcard_regex, Regexp::IGNORECASE)}/i\"\n\n rule = wildcard_generalization.gsub(\"#{wildcard}\", \"(.+)\")\n #ap \"rule #{rule}\"\n #binding.pry\n if value = cause_sentence.join(\" \").match(Regexp.new(rule, Regexp::IGNORECASE))\n value = value[-1]\n prop = attr_name_from_type_param(generalization)\n\n local_candidate = local_candidate.merge({\n attrs: {\n prop => value\n },\n score: 0.75\n })\n end\n\n # If we find a learned generalization that matches the generalized\n # sentence, we will save it.\n elsif generalization == cause_rule\n cause_rule.split(\" \").each_with_index do |typed_string, index|\n\n # If the learned generalization has a type anywhere, we will\n # check what is the corresponding word in the cause sentence.\n #\n # For example, consider the following sentence:\n #\n # [type:subject] want a [type:make]\n #\n # and the sentence\n #\n # I want a ford\n #\n # Finding `[type:make]` at position 3 of the array, we will\n # get `ford` at the position 3 of the cause sentence. With\n # that we can come up with `{make: 'ford'}`.\n #\n if typed_string =~ /\\[type/i\n local_candidate[:score] += 1\n type = attr_name_from_type_param(typed_string)\n prop = type_properties(type)\n type_token_length = prop[:token_length]\n\n # In `i want a car`, this will get the `i`. If the type\n # says instead that it's formed by two symbols (e.g\n # `i want`), then it will take `i want`.\n #\n # The -1 in the brackets is because otherwise it would be\n # translated to the following if the type had 1 symbol\n #\n # cause_sentence[1..1+1]\n #\n # That would take 2 words (`[1..2]`). We want one word, so\n #\n # cause_sentence[1..1+1-1]\n #\n word_for_type = cause_sentence[index..index+(type_token_length-1)]\n #ap \"> type: #{type} - #{index} #{cause_sentence[index..index+type_token_length]}\"\n\n local_candidate[:attrs][type] = word_for_type.join(\" \")\n\n # When it's just the same sentence as one seen before, no\n # generalizations\n else\n local_candidate[:score] = 1\n end\n end\n\n end\n end\n\n if local_candidate[:score] > 0\n candidates << local_candidate\n end\n end\n end\n\n # TODO - normalization is taking out some elements that are good.\n #candidates = normalize_scores(candidates)\n candidates = pick_candidates(candidates)\n candidates = merge_attributes(candidates)\n\n candidates\n end", "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n #use the built-in error checking\n if not runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n #assume the occ sensors will last the full analysis\n expected_life = 25\n \n #assign the user inputs to variables\n space_type_object = runner.getOptionalWorkspaceObjectChoiceValue(\"space_type\",user_arguments,model)\n percent_runtime_reduction = runner.getDoubleArgumentValue(\"percent_runtime_reduction\",user_arguments)\n material_and_installation_cost_per_space = runner.getDoubleArgumentValue(\"material_and_installation_cost_per_space\",user_arguments)\n\n #check the space_type for reasonableness and see if measure should run on space type or on the entire building\n apply_to_building = false\n space_type = nil\n if space_type_object.empty?\n handle = runner.getStringArgumentValue(\"space_type\",user_arguments)\n if handle.empty?\n runner.registerError(\"No space type was chosen.\")\n else\n runner.registerError(\"The selected space type with handle '#{handle}' was not found in the model. It may have been removed by another measure.\")\n end\n return false\n else\n if not space_type_object.get.to_SpaceType.empty?\n space_type = space_type_object.get.to_SpaceType.get\n elsif not space_type_object.get.to_Building.empty?\n apply_to_building = true\n else\n runner.registerError(\"Script Error - argument not showing up as space type or building.\")\n return false\n end\n end\n \n #check arguments for reasonableness\n if percent_runtime_reduction >= 100\n runner.registerError(\"Percent runtime reduction must be less than 100.\")\n return false\n end\n\n #find all the original schedules (before occ sensors installed)\n original_lts_schedules = []\n if apply_to_building #apply to the whole building\n \n model.getLightss.each do |light_fixture|\n if light_fixture.schedule.is_initialized\n original_lts_schedules << light_fixture.schedule.get\n end\n end\n else #apply to the a specific space type\n #do the lights assigned to the space type itself\n space_type.lights.each do |light_fixture|\n if light_fixture.schedule.is_initialized\n original_lts_schedules << light_fixture.schedule.get\n end\n end\n #do the lights in each space of the selected space type\n space_type.spaces.each do |space|\n space.lights.each do |light_fixture|\n if light_fixture.schedule.is_initialized\n original_lts_schedules << light_fixture.schedule.get\n end\n end \n end\n end\n \n #make copies of all the original lights schedules, reduced to include occ sensor impact\n original_schs_new_schs = {}\n original_lts_schedules.uniq.each do |orig_sch|\n #TODO skip non-schedule-ruleset schedules\n \n #copy the original schedule\n new_sch = orig_sch.clone.to_ScheduleRuleset.get\n #reduce each value in each profile (except the design days) by the specified amount\n runner.registerInfo(\"Reducing values in '#{orig_sch.name}' schedule by #{percent_runtime_reduction}% to represent occ sensor installation.\")\n day_profiles = []\n day_profiles << new_sch.defaultDaySchedule\n new_sch.scheduleRules.each do |rule|\n day_profiles << rule.daySchedule\n end\n multiplier = (100 - percent_runtime_reduction)/100\n day_profiles.each do |day_profile|\n #runner.registerInfo(\"#{day_profile.name}\")\n times_vals = day_profile.times.zip(day_profile.values)\n #runner.registerInfo(\"original time/values = #{times_vals}\")\n times_vals.each do |time,val|\n day_profile.addValue(time, val * multiplier)\n end\n #runner.registerInfo(\"new time/values = #{day_profile.times.zip(day_profile.values)}\")\n end \n #log the relationship between the old sch and the new, reduced sch\n original_schs_new_schs[orig_sch] = new_sch\n #runner.registerInfo(\"***\")\n end\n \n #replace the old schedules with the new schedules\n spaces_sensors_added_to = []\n if apply_to_building #apply to the whole building\n runner.registerInfo(\"Adding occupancy sensors to whole building\")\n model.getLightss.each do |light_fixture|\n next if light_fixture.schedule.empty?\n lights_sch = light_fixture.schedule.get\n new_sch = original_schs_new_schs[lights_sch]\n if new_sch\n runner.registerInfo(\"Added occupancy sensor for '#{light_fixture.name}'\")\n light_fixture.setSchedule(new_sch)\n spaces_sensors_added_to << light_fixture.space\n end\n end\n else #apply to the a specific space type\n #do the lights assigned to the space type itself\n runner.registerInfo(\"Adding occupancy sensors to space type '#{space_type.name}'\")\n space_type.lights.each do |light_fixture|\n next if light_fixture.schedule.empty?\n lights_sch = light_fixture.schedule.get\n new_sch = original_schs_new_schs[lights_sch]\n if new_sch\n runner.registerInfo(\"Added occupancy sensor for '#{light_fixture.name}'\")\n light_fixture.setSchedule(new_sch)\n spaces_sensors_added_to << light_fixture.space\n end\n end\n #do the lights in each space of the selected space type\n space_type.spaces.each do |space|\n runner.registerInfo(\"Adding occupancy sensors to space '#{space.name}\")\n space.lights.each do |light_fixture|\n next if light_fixture.schedule.empty?\n lights_sch = light_fixture.schedule.get\n new_sch = original_schs_new_schs[lights_sch]\n if new_sch\n runner.registerInfo(\"Added occupancy sensor for '#{light_fixture.name}'\")\n light_fixture.setSchedule(new_sch)\n spaces_sensors_added_to << light_fixture.space\n end\n end \n end\n end \n \n #report if the measure is not applicable\n num_sensors_added = spaces_sensors_added_to.uniq.size\n if spaces_sensors_added_to.size == 0\n runner.registerAsNotApplicable(\"This measure is not applicable because there were no lights in the specified areas of the building.\")\n return true\n end\n \n #report initial condition\n runner.registerInitialCondition(\"The building has several areas where occupancy sensors could be used to reduce lighting energy by turning off the lights while no occupants are present.\") \n \n #add cost of adding occ sensors\n if material_and_installation_cost_per_space != 0\n cost = OpenStudio::Model::LifeCycleCost.createLifeCycleCost(\"Add #{material_and_installation_cost_per_space} Occ Sensors to the Building\", model.getBuilding, material_and_installation_cost_per_space * num_sensors_added, \"CostPerEach\", \"Construction\", expected_life, 0)\n if cost.empty?\n runner.registerError(\"Failed to add costs.\")\n end\n end \n \n #report final condition\n if apply_to_building\n runner.registerFinalCondition(\"Add occupancy sensors to #{num_sensors_added} spaces in the building. The total cost to perform this is $#{material_and_installation_cost_per_space.round} per space, for a total cost of $#{(material_and_installation_cost_per_space * num_sensors_added).round}\")\n else\n runner.registerFinalCondition(\"Add occupancy sensors to #{num_sensors_added} #{space_type.name} spaces in the building. The total cost to perform this is $#{material_and_installation_cost_per_space.round} per space, for a total cost of $#{(material_and_installation_cost_per_space * num_sensors_added).round}\")\n end\n \n return true\n \n end", "def run\n checks.each(&:run)\n end", "def analyze phrase\n\t\t@meaningful_words = meaningful_words(phrase, \" \")\n\tend", "def words\n @words ||= (\n word_suggestions = []\n spellcheck = self.response[:spellcheck]\n if spellcheck && spellcheck[:suggestions]\n suggestions = spellcheck[:suggestions]\n unless suggestions.nil?\n # suggestions is an array: \n # (query term)\n # (hash of term info and term suggestion) \n # ...\n # (query term)\n # (hash of term info and term suggestion) \n # 'correctlySpelled'\n # true/false\n # collation\n # (suggestion for collation)\n i_stop = suggestions.index(\"correctlySpelled\")\n # step through array in 2s to get info for each term\n 0.step(i_stop-1, 2) do |i| \n term = suggestions[i]\n term_info = suggestions[i+1]\n # term_info is a hash:\n # numFound =>\n # startOffset =>\n # endOffset =>\n # origFreq =>\n # suggestion => { frequency =>, word => }\n origFreq = term_info['origFreq']\n suggFreq = term_info['suggestion']['frequency'] \n word_suggestions << term_info['suggestion']['word'] if suggFreq > origFreq\n end\n end\n end\n word_suggestions.uniq\n )\n end", "def check(*args)\n process_using(*args.unshift(:check))\n end", "def check\n each { |m| m.check }\n end", "def passed_checks\n self.completeness_checks.inject([]) do |passed, check| \n case check[:check]\n when Proc\n passed << translate_check_details(check) if check[:check].call(self)\n when Symbol\n passed << translate_check_details(check) if self.send check[:check]\n end\n \n passed\n end\n end", "def check_locale(dict_name, filepath)\n num_errors = 0\n locale_hash = recursive_parsing(YAML.load_file(filepath))\n\n FFI::Hunspell.dict(dict_name) do |dict|\n customize_dictionary(dict_name, dict)\n locale_hash.each do |key, sentence|\n # Ignore any variables for spell checking.\n sentence.gsub!(/%{\\w+}/, '')\n # Ignore the expected temperature guidance.\n sentence.gsub!('100.4°F/38°C', '')\n # Track if we already printed the YAML path and the sentence.\n already_put_context = false\n words = sentence.scan(/[[:alpha:]\\w'-]+/)\n words.each do |word|\n # Safety check if word is not actually a String.\n next if !word.is_a? String\n # dict.check? returns true if correctly spelled and false if incorrect.\n next if dict.check?(word)\n # Detected an error, so print the error and suggested fixes.\n if !already_put_context\n puts \"\\n\\t#{key}\"\n puts \"\\t#{sentence}\"\n already_put_context = true\n end\n puts \"\\t\\tSPELLING ERROR: #{word}\"\n puts \"\\t\\t\\tSUGGESTIONS: #{dict.suggest(word)}\"\n num_errors += 1\n end\n end\n end\n puts \"\\n\\tFound #{num_errors} errors when checking locale file #{filepath}\"\n num_errors\n end", "def check_that_no_text_run_is_active\n if @rt_run_context.inside_a_run\n raise \"Unexpected run! #{ @rt_run_context.inspect }\"\n end\n end", "def spell_check(string)\n string.downcase!\n block = ['bo','xk','dq', 'cp','na',\n 'gt' ,'re', 'fs', 'jw', 'hu',\n 'vi', 'ly', 'zm']\n tracker = false\n \n string.chars.each do |char|\n tracker = false # set to false as default value\n block.each do |pair| #check if a pair in the block contains char, returns true if so; otherwise leaves tracker unmodified\n if pair.include?(char)\n block.delete(pair)\n tracker = true \n end\n end\n end\n tracker\nend", "def keyword_check(kw)\n unless (@keywords || %w(a is of has)).include?(kw)\n raise RDF::ReaderError, \"unqualified keyword '#{kw}' used without @keyword directive\" if @strict\n end\n end", "def lookup_synsets( word, *args )\n\t\tdataset = WordNet::Synset.filter( :words => WordNet::Word.filter(lemma: word.to_s) )\n\t\tself.log.debug \"Looking up synsets for %p\" % [ word.to_s ]\n\n\t\t# Add filters to the dataset for each argument\n\t\targs.each do |arg|\n\t\t\tself.log.debug \" constraint arg: %p\" % [ arg ]\n\t\t\tcase arg\n\n\t\t\twhen Integer\n\t\t\t\tself.log.debug \" limiting to sense %d\" % [ arg ]\n\t\t\t\tdataset = dataset.limit( 1, arg-1 )\n\n\t\t\twhen Range\n\t\t\t\tself.log.debug \" limiting to range of senses: %p\" % [ arg ]\n\t\t\t\tdataset = dataset.limit( arg.end - arg.begin, arg.begin - 1 )\n\n\t\t\twhen Regexp\n\t\t\t\tself.log.debug \" filter: definition =~ %p\" % [ arg ]\n\t\t\t\tdataset = dataset.filter( definition: arg )\n\n\t\t\twhen Symbol, String\n\t\t\t\t# Lexical domain, e.g., \"verb.motion\"\n\t\t\t\tif domain = WordNet::Synset.lexdomains[ arg.to_s ]\n\t\t\t\t\tself.log.debug \" filter: lex domain: %s (%d)\" % [ arg, domain[:lexdomainid] ]\n\t\t\t\t\tdataset = dataset.filter( lexdomainid: domain[:lexdomainid] )\n\n\t\t\t\t# Part of speech symbol, e.g., \"v\"\n\t\t\t\telsif WordNet::Synset.postype_table.key?( arg.to_sym )\n\t\t\t\t\tself.log.debug \" filter: part of speech: %s\" % [ arg ]\n\t\t\t\t\tdataset = dataset.filter( pos: arg.to_s )\n\n\t\t\t\t# Part of speech name, e.g., \"verb\"\n\t\t\t\telsif pos = WordNet::Synset.postypes[ arg.to_s ]\n\t\t\t\t\tself.log.debug \" filter: part of speech: %s\" % [ pos.to_s ]\n\t\t\t\t\tdataset = dataset.filter( pos: pos.to_s )\n\n\t\t\t\t# Assume it's a definition match\n\t\t\t\telse\n\t\t\t\t\tpattern = \"%%%s%%\" % [ arg ]\n\t\t\t\t\tself.log.debug \" filter: definition LIKE %p\" % [ pattern ]\n\t\t\t\t\tdataset = dataset.filter { :definition.like(pattern) }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\treturn dataset.all\n\tend", "def lint(*args); end", "def perform_checks\n # tests & checks are only meaningful if the input can be varied\n return unless @input_can_change\n @checks.each_with_index do |check, i|\n output, time, error = run_with_benchmark(check[:input])\n @checks[i].merge!({ output: output, time: time, error: error })\n end\n @checks\n end", "def lint(name)\n before_lint\n public_send name\n after_lint\n true # for assertions\n end", "def spell(hash={})\n\t\t$_TAGHASH_['GSn'] = /<spell[^>]*?>([\\s\\w]+)<\\/spell>/o.match($_SERVERSTRING_).captures.first\n\tend", "def get_incorrect\n @mismatches = @solution.crossword.get_mismatches(params[:letters])\n if @mismatches.empty?\n @solution.update_attributes(is_complete: true)\n end\n end", "def keyword_check(kw)\n unless (@keywords || %w(a is of has)).include?(kw)\n raise RDF::ReaderError, \"unqualified keyword '#{kw}' used without @keyword directive\" if validate?\n end\n end", "def reload!\n $LOADED_FEATURES.each { |file| load file if file.include?('spellchecker') }\n\n 'ok'\nend", "def before_lint; end", "def analize!\n SpinningCursor.run do\n banner \"Analyzing\".yellow\n type :dots\n \n action do\n read_configs!\n load_config!\n load_target_constants!\n load_against_constants!\n match!\n send_out!\n end\n end\n end", "def keyboard_block_spell_check\n return @keyboard_block_spell_check\n end", "def test_word\n 42.times { assert @standard_wordlist.include?(@tester.word) }\n end", "def keyboard_block_spell_check=(value)\n @keyboard_block_spell_check = value\n end", "def check\n \n end", "def check\n \n end", "def set_spelling_test\n @spelling_test = SpellingTest.find(params[:id])\n end", "def clean\n clean_announces\n clean_tests\n puts 'All clean!'\nend", "def word_checker(word_possibility)\n valid_words=[]\n word_possibility.each{ |word|\n if (system(\"look #{word} > new.txt\"))\n if response(word)[0] !=nil\n valid_words << word\n break\n end\n end\n }\n valid_words\n end", "def double_check\n if any_damage?\n @used = true\n @missed = false\n @evaded = false\n end\n end", "def run_checks\n bad_refs(qtag_count) do |qt|\n yield Error.new(survey, Question, :bad_ref, qt, qtag_expectations[qt])\n end\n\n bad_refs(atag_count) do |qt, at|\n yield Error.new(survey, Answer, :bad_ref, at, atag_expectations[[qt, at]])\n end\n\n bad_refs(ctag_count) do |c, tag|\n yield Error.new(survey, Condition, :bad_ref, tag, c)\n end\n\n by_qref.select { |k, v| v.length > 1 }.each do |k, vs|\n yield Error.new(survey, Question, :duplicate_qref, k, vs)\n end\n end", "def determine_correctness\n answer = self.question.answer\n \t#Upcase to take care of all capitalization issues\n \tresponse = self.content.upcase\n\n \tanswer = answer.split(', ')\n\n \t#Score Keeping\n \tscore = 0\n \tscore_incremental = 1.0/answer.length\n \t\n \t#Determining how many of keywords are in response\n \tanswer.each do |correct_word|\n \t\tcorrect_word = correct_word.upcase\n \t\tif response.include?(correct_word)\n \t\t\tscore += score_incremental\n \t\tend\n \tend\n \tself.correctness = score\n end", "def completeness_check\n available = (@rules + @leaves).map(&:name).to_set\n sought = @rules.flat_map(&:seeking).uniq.to_set\n problems = sought.reject { |s| available.include? s }\n raise Error, \"the following rules or leaves remain undefined: #{problems.join(', ')}\" if problems.any?\n end", "def runAnalyzer(num_samples,inhash)\n # select profile for run\n show do \n title \"Select #{QIAXCEL_TEMPLATE[inhash[:sampleTypes]]}\" # this is just a profile name, should be ok for other polymerases\n note \"Click <b>Back to Wizard</b> if previous data is displayed.\"\n check \"Under <b>Process -> Process Profile</b>, make sure <b>#{QIAXCEL_TEMPLATE[inhash[:sampleTypes]]}</b> is selected.\"\n end\n \n # select alignment marker\n ref_marker = (inhash[:sampleTypes] == 'DNA') ? REF_MARKERS[inhash[:type_ind]][inhash[:cutoff_ind]] : REF_MARKERS[inhash[:type_ind] ]\n show do \n title \"Select alignment marker\"\n check \"Under <b>Marker</b>, in the <b>Reference Marker </b> drop-down, select <b>#{ref_marker}</b>. A green dot should appear to the right of the drop-down.\"\n end\n \n # empty rows\n if inhash[:sampleTypes] == 'RNA'\n num_samples = num_samples + 1 # Include the ladder in the first well of the first stripwell\n nonempty_rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n (num_samples % WELLS_PER_STRIPWELL) > 0 ? nonempty_rows + 1 : nonempty_rows\n else\n nonempty_rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n end\n show do \n title \"Deselect empty rows\"\n check \"Under <b>Sample selection</b>, deselect all rows but the first #{nonempty_rows}.\"\n end\n \n # check \n show do \n title \"Perform final check before running analysis\"\n note \"Under <b>Run Check</b>, manually confirm the following:\"\n check \"Selected rows contain samples.\"\n check \"Alignment marker is loaded (changed every few weeks).\"\n end\n \n # run and ask tech for remaining number of runs\n run_data = show do \n title \"Run analysis\"\n note \"If you can't click <b>Run</b>, and there is an error that reads <b>The pressure is too low. Replace the nitrogen cylinder or check the external nitrogen source</b>, close the software, and reopen it. Then restart at title - <b>Select #{QIAXCEL_TEMPLATE[inhash[:sampleTypes]]} </b>\"\n check \"Otherwise, click <b>Run</b>\"\n note \"Estimated time of experiment is given at the bottom of the screen\"\n get \"number\", var: \"runs_left\", label: \"Enter the number of <b>Remaining Runs</b> left in this cartridge\", default: 0\n #image \"frag_an_run\"\n end\n \n # return\n run_data[:runs_left]\n \n end", "def attr_check(text)\n Log.message(\"Checking attributes contains <#{text}> for #{@name} >>\")\n\n if @title.include?(text) || @description.include?(text) || @skills.join(' ').include?(text)\n\n @title.include?(text) ? Log.message(\"Title attribute contains <#{text}>\") : Log.warning(\"Title attribute NOT contains <#{text}>\")\n @description.include?(text) ? Log.message(\"Description attribute contains <#{text}>\") : Log.warning(\"Description attribute NOT contains <#{text}>\")\n @skills.join(' ').include?(text) ? Log.message(\"Skills attribute contains <#{text}>\") : Log.warning(\"Skills attribute NOT contains <#{text}>\")\n\n true\n else\n\n Log.error(\"No one attribute contains <#{text}>\")\n\n false\n end\n end", "def set_class_spell\n @class_spell = ClassSpell.find(params[:id])\n end" ]
[ "0.7094114", "0.65429735", "0.60914516", "0.5973861", "0.5959402", "0.56555307", "0.5457493", "0.54477775", "0.53906095", "0.5385877", "0.5344768", "0.5335884", "0.5333769", "0.53216285", "0.52984506", "0.52297664", "0.51652765", "0.5151356", "0.5128848", "0.5100648", "0.50899583", "0.50815564", "0.5049853", "0.5046728", "0.5034553", "0.50163", "0.50061387", "0.50061387", "0.50056964", "0.4997832", "0.4963974", "0.4959577", "0.4946133", "0.4942263", "0.49227488", "0.49217433", "0.49214417", "0.49164695", "0.4907581", "0.4893114", "0.487409", "0.48718187", "0.4870171", "0.48686746", "0.486757", "0.48638147", "0.48632085", "0.4809712", "0.48079517", "0.4788726", "0.47736922", "0.47598487", "0.4759791", "0.4753909", "0.4750937", "0.47503895", "0.47498956", "0.47496617", "0.47493926", "0.47409427", "0.47296348", "0.47202334", "0.4716912", "0.47103295", "0.47054163", "0.47049448", "0.47048587", "0.46966735", "0.46936414", "0.46933556", "0.46915674", "0.46853405", "0.46833447", "0.46790093", "0.467655", "0.4664759", "0.4659819", "0.4658578", "0.46511084", "0.46500477", "0.46480316", "0.4642182", "0.46397728", "0.4628083", "0.46242154", "0.46224737", "0.462164", "0.46187437", "0.4614564", "0.4614564", "0.4613887", "0.46119356", "0.46100304", "0.46092522", "0.4600328", "0.45981395", "0.4596849", "0.4590992", "0.45894435", "0.4587206" ]
0.8056898
0
Never trust parameters from the scary internet, only allow the white list through.
def admin_params params.permit(:username, :email, :password, :password_confirmation) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Epay::Subscription.create(:card_no => '...', :)
def create(params) params.merge!( :order_no => (Time.now.to_f * 10000).to_i.to_s, # Produce a unique order_no - it's not used anywhere, but ePay needs this :amount => 0 ) post = Api.default_post_for_params(params).merge({ :subscription => 1, :subscriptionname => params[:description] }) query = Api.authorize(post) if query['accept'] # Return the new subscriber subscription = new(query["subscriptionid"].to_i).reload # Set (obfuscated) card number: subscription.card_no = query["tcardno"] subscription else new(nil, 'error' => query["error"]) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_subscription(credit_card, options = {})\n\n u = self.user\n options[:order_id] = number # currently just loading a date\n options[:email] = u.email\n options[:address] = {\n :first_name => u.first_name,\n :last_name => u.last_name,\n :address1 => u.street_address1,\n :address2 => (u.street_address2 || \"\"),\n :company => (u.company || \"\"),\n :city => u.city,\n :state => u.us_state,\n :zip => u.zip,\n :country => 'United States',\n :phone => u.primary_phone\n }\n\n subscription = OrderTransaction.generate_yearly_subscription(credit_card, options)\n self.save!\n order_transactions << subscription\n\n if subscription.success?\n self.payment_captured!\n else\n self.transaction_declined!\n end\n\n subscription\n end", "def save_withsubscription\n if valid?\n customer = Stripe::Customer.create(description: email, plan: plan_id, card: stripe_card_token)\n self.stripe_card_token = customer.id\n save!\n end\n end", "def create_card\n card = customer.sources.create(source: \"tok_amex\")\n self.stripe_card_id = card.id\n self.save\n card\n end", "def create_stripe_subscription(card_details)\n @error = \"\"\n\t\tbegin\n\t\t\tcustomer = Stripe::Customer.create(\n\t\t\t\t:email => self.email,\n\t\t \t\t## if you are using the js to fetch the stripe_card_token change the ':card => card_details[\"stripe_card_token\"]' ##\n\t\t \t\t:card => {\n\t\t \t\t\t:number => card_details[\"card_number\"],\n\t\t \t\t\t:exp_month => card_details[\"exp_month\"],\n\t\t \t\t\t:exp_year => card_details[\"exp_year\"],\n\t\t \t\t\t:cvc => card_details[\"cvc\"]\n },\n\t\t\t :plan => card_details[\"plan_id\"]\n )\n\n \t\tputs \"==Customer_id : ====#{customer.id}============\"\n puts \"--------------User Model Stripe Customer Object: \" + customer.inspect\n @transaction = Transaction.new( :user_id => self.id,\n :payment_service => \"Stripe\",\n :trans_type => \"CreateStripeCustomer\",\n :stripe_id => customer.id,\n :last4 => customer.cards.data.first['last4'],\n :brand => customer.cards.data.first['brand'],\n :funding => customer.cards.data.first['funding'],\n :exp_month => customer.cards.data.first['exp_month'],\n :exp_year => customer.cards.data.first['exp_year']\n )\n unless @transaction.save\n puts \"-----UserModel - Stripe - Our Transaction Did Not Save on Stripe Fail\"\n end\n\n\t \trescue Stripe::StripeError => e\n logger.warn(\"====#{e.message}==\")\n puts \"====User-Model - Stripe Transaction Failed Due to #{e.message}=====\"\n @error = (\"card error: \" + e.message)\n # Transaction Error Record Created In Controller\n # @transaction = Transaction.new( :user_id => self.id,\n # :payment_service => \"Stripe\",\n # :trans_type => \"Failed\",\n # :stripe_callback_data => @error\n # )\n # unless @transaction.save\n # puts \"-----UserModel - Stripe - Our Transaction Did Not Save on Stripe Fail\"\n # end\n\t\tend\n\t\treturn @error\n\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n @subscription.sub_create(current_user,subscription_params[:stripe_plan_id],subscription_params[:coupon_code])\n\n # Create a subscription with the following information:\n #\n # 1) Customer Account\n # 2) Subscription Type (GOLD, Silver, etc.)\n # 3) Discount Coupom (if applicable)\n\n if @subscription.save\n redirect_to @subscription, notice: 'Subscription was successfully created.'\n else\n @verrors = @subscription.errors.full_messages\n render 'new'\n end\n end", "def save_with_subscription\n #If user data passes validations, then call Stripe with user information\n #to get a new subscription created upon charging their card\n if valid?\n customer = Stripe::Customer.create(description: email, plan: plan_id, card: stripe_card_token)\n self.stripe_customer_token = customer.id\n save!\n end\n end", "def create_subscription(payment_intent_id)\n result = ChargeBee::Subscription.create({\n plan_id: '<chargebee-plan-id>',\n auto_collection: 'on',\n payment_intent: {\n gateway_account_id: '<checkout.com-gateway-id>',\n gw_token: payment_intent_id\n }\n })\n subscription = result.subscription\n puts \"Chargebee subscription ID: #{subscription.id} created for Checkout.com payment ID: #{payment_intent_id}\"\n end", "def create_buyer email_address, card_uri, name=nil, meta={}\n account = Account.new(\n :uri => self.accounts_uri,\n :email_address => email_address,\n :card_uri => card_uri,\n :name => name,\n :meta => meta,\n )\n account.save\n end", "def create_buyer email_address, card_uri, name=nil, meta={}\n account = Account.new(\n :uri => self.accounts_uri,\n :email_address => email_address,\n :card_uri => card_uri,\n :name => name,\n :meta => meta,\n )\n account.save\n end", "def save_with_subscription\n if valid?\n customer = Stripe::Customer.create(description: email, plan: plan_id, card: stripe_card_token)\n # save customer id in DB with response\n self.stripe_customer_token = customer.id \n # runs save\n save!\n end\n end", "def create\n\t\t#Prepare the models\n\t\t@subscription = Subscription.new(\n\t\t\tcampaign_id: @subscribed.active_campaign.id,\n\t\t\tshipping_country: params[:subscription][:shipping_country],\n\t\t\tget_reward: params[:subscription][:get_reward],\n\t\t\tfunding_type: params[:subscription][:funding_type],\n\t\t\tamount: params[:subscription][:amount],\n\t\t\tsubscriber_id: @subscriber.id,\n\t\t\tsubscribed_id: @subscribed.id,\n\t\t\tcurrency: 'usd',\n\t\t\tcampaign_funding_type: @subscribed.active_campaign.funding_type\n\t\t)\n\t\tif params[:subscription][:majorpost_id]\n\t\t\t@subscription.majorpost_id = params[:subscription][:majorpost_id]\n\t\tend\n\t\tif params[:subscription][:upper_limit]\n\t\t\t@subscription.upper_limit = params[:subscription][:upper_limit]\n\t\tend\n\t\tif params[:subscription][:cards_attributes]\n\t\t\tadd_card\n\t\tend\n\t\t#Charge if charge\n\t\tif @subscription.funding_type == 'one_time'\n\t\t\t#Charge the card now\n\t\t\tsubscribe_through_stripe\n\t\telse\n\t\t\t#Do not charge the card\n\t\t\tsubscription_post_payment\n\t\tend\n\trescue Stripe::CardError => e\n\t\t# Since it's a decline, Stripe::CardError will be caught\n\t\tbody = e.json_body\n\t\terr = body[:error]\n\n\t\tputs \"Status is: #{e.http_status}\"\n\t\tputs \"Type is: #{err[:type]}\"\n\t\tputs \"Code is: #{err[:code]}\"\n\t\t# param is '' in this case\n\t\tputs \"Param is: #{err[:param]}\"\n\t\tputs \"Message is: #{err[:message]}\"\n\t\t#Show to the user\n\t\tflash[:error] = \"#{err[:message]}\"\n\t\tredirect_to how_i_pay_user_studio_wallets_path(@subscriber.username)\n\trescue Stripe::RateLimitError => e\n\t\t# Too many requests made to the API too quickly\n\t\tflash[:error] = t('errors.messages.too_many_requests')\n\t\tredirect_to profile_url_path(@subscribed.username)\n\trescue Stripe::InvalidRequestError => e\n\t\t# Invalid parameters were supplied to Stripe's API\n\t\tflash[:error] = t('errors.messages.not_saved')\n\t\tredirect_to profile_url_path(@subscribed.username)\n\trescue Stripe::AuthenticationError => e\n\t\t# Authentication with Stripe's API failed\n\t\t# (maybe you changed API keys recently)\n\t\tflash[:error] = t('errors.messages.not_saved')\n\t\tredirect_to profile_url_path(@subscribed.username)\n\trescue Stripe::APIConnectionError => e\n\t\t# Network communication with Stripe failed\n\t\tflash[:error] = t('errors.messages.not_saved')\n\t\tredirect_to profile_url_path(@subscribed.username)\n\trescue Stripe::StripeError => e\n\t\t# Display a very generic error to the user, and maybe send\n\t\t# yourself an email\n\t\tflash[:error] = t('errors.messages.not_saved')\n\t\tredirect_to profile_url_path(@subscribed.username)\n\trescue \n\t\t# General rescue\n\t\tflash[:error] = t('errors.messages.not_saved')\n\t\tredirect_to profile_url_path(@subscribed.username)\n\tend", "def save_with_subscription\n if valid?\n customer = Stripe::Customer.create(description: email, card: stripe_card_token)\n self.stripe_customer_token = customer.id\n save! \n end\n end", "def test_association_create_creates_one_association\n today = Date.today\n account = Account.create!\n card_expiration = account.card_expirations.create!(\n :payment_method_token => \"abcdefg\",\n :expiration_date => today\n )\n\n assert_equal [card_expiration], account.card_expirations\n end", "def create_subscription(options)\n stripe_service.create_subscription(options)\n end", "def save_payment_card(card_name, token, exp)\n card = user.payment_cards.where(kind: payment_kind, last4: last4, name: card_name, exp: exp).first_or_create!(customer_id: token)\n self.payment_card = card\n start_recurring_payment if save\n end", "def test_store_invalid_credit_card\n @credit_card.number = 2\n\n assert response = @gateway.store(@credit_card, @options)\n assert_success response\n end", "def create_stripe_subscription!\n Stripe::Subscription.create(\n customer: create_stripe_customer!,\n tax_percent: Price::DEFAULT_TAX_RATE,\n trial_from_plan: store.eligible_for_trial_subscription?,\n items: [\n {plan: stripe_plan_id},\n ],\n metadata: {store: store.name}\n )\n end", "def purchase_sub_new_card\n token = params[:stripeToken]\n @plan = params[:plan] #integer corresponding to my_plan_id\n @events_number = params[:events_number] \n @code = params[:code]\n @new_price = params[:new_price]\n\n if update_card_and_new_subscription(token, @plan, @code)\n c = Stripe::Customer.retrieve(current_user.customer_id)\n \n #create new subscription object in my database\n @sub = Subscription.new(:user_id => current_user.id, :email => current_user.email, :customer_id => c.id, :my_plan_id => @plan, :plan_name => Plan.find_by_my_plan_id(@plan).name, :active => true)\n @sub.events_remaining = @events_number\n @sub.coupon = @code \n @sub.save \n\n #create receipt\n @r = Receipt.new(:user_id => current_user.id, :email => current_user.email, :customer_id => c.id,\n :subscription_id => @sub.id, :sub_my_plan_id => @sub.my_plan_id, :sub_plan_name => @sub.plan_name,\n :sub_events_number => @sub.events_remaining, :sub_reg_monthly_cost_in_cents => Plan.find_by_my_plan_id(@sub.my_plan_id).monthly_cost_cents,\n :sub_actual_monthly_cost_in_cents => @new_price, :sub_coupon_name => @sub.coupon) \n @r.save\n\n #mail receipt\n UserMailer.sub_receipt(current_user, @r).deliver\n\n flash[:success] = \"Thank you for subscribing to the #{Plan.find_by_my_plan_id(@plan).name.titleize} plan!\"\n redirect_to current_user\n\n else\n redirect_to purchase_sub_existing_path\n end \n\n\nend", "def create_account_card\n tmp = Card.create! name: \"Company+scratch\"\n tmp.update! name: \"Company+*account\"\n end", "def create_account_and_create_subscription account_name\n contact = {\n address1: '1051 E Hillsdale Blvd',\n city: 'Foster City',\n country: 'United States',\n firstName: 'John',\n lastName: 'Smith',\n zipCode: '94404',\n state: 'CA'\n }\n\taccount_number = create_account account_name, contact\n\tputs '### Account created in Zuora with number: '+ account_number\n #get the rate plans for the product\n\tproduct_rate_plan = get_product_rate_plans_for_product 'Medium Monthly Plan w Discount'\n #create the subscription\n\tsubscription_number = create_subscription(\n account_number,\n DateTime.now.strftime(\"%Y-%m-%d\"),\n product_rate_plan['id']\n )\n\tputs '### Subscription created in Zuora with number: ' + subscription_number\n return subscription_number\nend", "def save_with_subscription\n if valid?\n customer = Stripe::Customer.create(description: email, plan: plan_id, card: stripe_card_token)\n self.stripe_customer_token = customer.id\n save!\n end\n end", "def test_requiring_credit_card_for_pay_plan\n subscription = Factory.build(:free_subscription, :subscription_plan => Factory(:paid_plan), :credit_card => nil)\n subscription.valid?\n\n assert subscription.errors.on(:credit_card)\n end", "def purchase_sub_existing_card\n @plan = params[:sub][:plan] #integer corresponding to my_plan_id\n @events_number = params[:sub][:events_number]\n @code = params[:sub][:code]\n @new_price = params[:sub][:new_price]\n\n # retrieve stripe customer object yet again\n if !current_user.customer_id.blank?\n c = Stripe::Customer.retrieve(current_user.customer_id)\n end \n \n if is_valid_sub_coupon(@code) \n\n #create subscription for this customer in stripe (note that update_subscription creates a new subscription for this customer in this case)\n if has_not_trialed?\n c.update_subscription(:plan => @plan, :coupon => @code)\n else\n c.update_subscription(:plan => @plan, :trial_end => (Date.today + 1.day).to_time.to_i, :coupon => @code) \n end \n #create new subscription object in my database\n @sub = Subscription.new(:user_id => current_user.id, :email => current_user.email, :customer_id => c.id, :my_plan_id => @plan, :plan_name => Plan.find_by_my_plan_id(@plan).name, :active => true)\n @sub.events_remaining = @events_number\n @sub.coupon = @code\n @sub.save \n\n #create receipt\n @r = Receipt.new(:user_id => current_user.id, :email => current_user.email, :customer_id => c.id,\n :subscription_id => @sub.id, :sub_my_plan_id => @sub.my_plan_id, :sub_plan_name => @sub.plan_name,\n :sub_events_number => @sub.events_remaining, :sub_reg_monthly_cost_in_cents => Plan.find_by_my_plan_id(@sub.my_plan_id).monthly_cost_cents,\n :sub_actual_monthly_cost_in_cents => @new_price, :sub_coupon_name => @sub.coupon) \n @r.save\n\n #mail receipt\n UserMailer.sub_receipt(current_user, @r).deliver\n\n else\n #create subscription for this customer in stripe (note that update_subscription creates a new subscription for this customer in this case)\n if has_not_trialed?\n c.update_subscription(:plan => @plan)\n else\n c.update_subscription(:plan => @plan, :trial_end => (Date.today + 1.day).to_time.to_i) \n end \n #create new subscription object in my database\n @sub = Subscription.new(:user_id => current_user.id, :email => current_user.email, :customer_id => c.id, :my_plan_id => @plan, :plan_name => Plan.find_by_my_plan_id(@plan).name, :active => true)\n @sub.events_remaining = @events_number\n @sub.save \n\n #create receipt\n @r = Receipt.new(:user_id => current_user.id, :email => current_user.email, :customer_id => c.id,\n :subscription_id => @sub.id, :sub_my_plan_id => @sub.my_plan_id, :sub_plan_name => @sub.plan_name,\n :sub_events_number => @sub.events_remaining, :sub_reg_monthly_cost_in_cents => Plan.find_by_my_plan_id(@sub.my_plan_id).monthly_cost_cents,\n :sub_actual_monthly_cost_in_cents => @new_price, :sub_coupon_name => @sub.coupon) \n @r.save\n\n #mail receipt\n UserMailer.sub_receipt(current_user, @r).deliver\n end \n\n\n flash[:success] = \"Thank you! You are now subscribed to the #{Plan.find_by_my_plan_id(@plan).name.titleize} plan!\"\n redirect_to current_user\n\n #rescue Stripe::StripeError => e # THIS CODE WORKS!!! NEEED TO FIGURE OUT HOW EXACTLY\n # logger.error \"Stripe error while creating subscription w/o active sub for existing user with card on file (purchase_sub_existing_card)\"\n # flash[:error] = \"Something went wrong. Please try again or contact us!\"\n # redirect_to current_user\n\nend", "def create_new_subscription\n @subscription_offers = Subscription.get_subscription_list\n end", "def success\n if params[:reference].present?\n\n paystackObj = Paystack.new(ENV['PAYSTACK_PUBLIC_KEY'], ENV['PAYSTACK_PRIVATE_KEY'])\n\n subscriptions = PaystackSubscriptions.new(paystackObj)\n result = subscriptions.create(\n\n :customer => current_user.email,\n :plan => \"PLN_96ws6ovviw8028d\", #plan id\n :amount => 200000 #in KOBO\n\n \n )\n\n\n u = current_user\n u.subscribed = true\n u.subscription_code = code\n u.email_token = token\n u.save!\n \n else\n redirect_to new_subscription_path, notice: \"Error Making Payment, Try Again\"\n\n end\n end", "def create_payment_card(params)\n c_r Lokalise::Resources::PaymentCard, :create, nil, params\n end", "def create\n @eno_card = EnoCard.new(eno_card_params)\n\n respond_to do |format|\n if @eno_card.save\n format.html { redirect_to @eno_card, notice: 'Eno card was successfully created.' }\n format.json { render :show, status: :created, location: @eno_card }\n else\n format.html { render :new }\n format.json { render json: @eno_card.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @subscription = Subscription.new(params[:subscription])\n @subscription.quantity = @subscription.subscription_type.number_of_issues\n @subscription.unit_cost = @subscription.subscription_type.unit_cost\n \n respond_to do |format|\n if @subscription.save\n flash[:notice] = 'Subscription was successfully created.'\n format.html { redirect_to(@subscription) }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new_credit_card\n # populate new card with some saved values\n ActiveMerchant::Billing::CreditCard.new(\n :first_name => user.first_name,\n :last_name => user.last_name,\n # :address etc too if we have it\n :brand => cc_type\n )\n end", "def create_payment\n payment = ShopPayment.new({\n :order => @order,\n :gateway => gateway_name,\n :amount => @order.price,\n :card_type => card_type,\n :card_number=> card_number_secure\n })\n \n @order.update_attribute(:status, 'paid')\n \n @result[:payment] = payment.save\n end", "def create_first_payment\n make_payment\n end", "def create_wepay_account\n if self.has_wepay_access_token? && !self.has_wepay_account?\n params = { :name => self.name, :description => \"Event - \" + self.name }\t\t\t\n response = GemsUsage::Application::WEPAY.call(\"/account/create\", self.wepay_access_token, params)\n\n if response[\"account_id\"]\n self.wepay_account_id = response[\"account_id\"]\n return self.save\n else\n raise \"Error - \" + response[\"error_description\"]\n end\n\n end\t\t\n raise \"Error - cannot create WePay account\"\nend", "def create\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::POST_SUBSCRIPTION\n\n args.req_body = ZAPIArgs.new\n args.req_body.accountKey = SAMPLE_ACCOUNT_KEY\n args.req_body.contractEffectiveDate = '2013-02-1'\n args.req_body.termType = 'TERMED'\n args.req_body.initialTerm = '12'\n args.req_body.autoRenew = true\n args.req_body.renewalTerm = \"3\"\n args.req_body.notes = 'Test POST subscription from z-ruby-sdk'\n args.req_body.subscribeToRatePlans = []\n args.req_body.subscribeToRatePlans[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].productRatePlanId = 'ff8080811ca15d19011cdda9b0ad3b51'\n args.req_body.subscribeToRatePlans[0].chargeOverrides = []\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0] = ZAPIArgs.new\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].productRatePlanChargeId =\n 'ff8080811ca15d19011cddad8c953b53'\n args.req_body.subscribeToRatePlans[0].chargeOverrides[0].quantity = 10\n args.req_body.invoiceTargetDate = '2013-12-31'\n args.req_body.invoiceCollect = false\n\n puts \"========== CREATE A SUBSCRIPTION ============\"\n\n begin\n @z_client.post(args) do |resp|\n ap resp\n return resp.subscriptionNumber if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end", "def create_account_and_subscribe_single_call account_name\n contact = {\n address1: '1051 E Hillsdale Blvd',\n city: 'Foster City',\n country: 'United States',\n firstName: 'John',\n lastName: 'Smith',\n zipCode: '94404',\n state: 'CA'\n }\n #get the rate plans for the product\n product_rate_plan = get_product_rate_plans_for_product 'Medium Monthly Plan'\n myDate = DateTime.now + 10.days;\n #create an account and subscribe to a rate plan at the same time\n subscribe(\n account_name,\n contact,\n DateTime.now.strftime(\"%Y-%m-%d\"),\n myDate.strftime(\"%Y-%m-%d\"),\n product_rate_plan['id']\n )\nend", "def create\n @exchange = Exchange.new(params[:exchange])\n # Save exchange and subscribe current_user to newly created exchange\n respond_to do |format|\n if @exchange.save\n Subscription.create(:user_id => current_user.id, :exchange_id => @exchange.id)\n# subscriptions = current_user.exchanges.collect(&:id) + [@exchange.id]\n# current_user.exchange_ids = params[:user][:exchange_ids] ||= [] # Sets up user subscriptions\n# current_user.update_attributes(:exchange_ids => subscriptions)\n flash[:notice] = 'Exchange was successfully created.'\n format.html { redirect_to(@exchange) }\n format.xml { render :xml => @exchange, :status => :created, :location => @exchange }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @exchange.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_gocardless_subscription\n GO_CARDLESS_CLIENT.subscriptions.create(\n params: {\n amount: User::PLAN_AMOUNT.to_i,\n currency: User::GO_CARDLESS_CURRENCY,\n name: User::GO_CARDLESS_NAME,\n interval_unit: User::INTERVAL_UNIT,\n interval: 1,\n start_date: Date.current + 2.month,\n day_of_month: 1,\n links: {\n mandate: current_user.go_cardless_mandate\n }\n }\n )\n end", "def create_account\n account = Account.new(:email => email, :subdomain => subdomain)\n account.save!\n end", "def show\n account_code = params[:account_code]\n plan_code = params[:plan]\n user = User.find_by_email(account_code)\n @subscription = Subscription.create(account_code: account_code, plan_code: plan_code, user_id: user.id)\n end", "def test_successful_purchase_with_emv_credit_card_in_us\n assert response = @gateway.purchase(@amount, @emv_credit_cards[:us], @options)\n assert_success response\n assert_equal 'charge', response.params['object']\n assert response.params['paid']\n assert_match CHARGE_ID_REGEX, response.authorization\n end", "def set_eno_card\n @eno_card = EnoCard.find(params[:id])\n end", "def create\n # Amount in cents\n @amount = 1500\n\n customer = Stripe::Customer.create(\n :email => current_user.email,\n :card => params[:stripeToken]\n )\n\n charge = Stripe::Charge.create(\n :customer => customer.id,\n :amount => @amount,\n :description => 'Tshirtgram T-shirt',\n :currency => 'GBP'\n )\n\n\n rescue Stripe::CardError => e\n flash[:error] = e.message\n redirect_to root_path\n\n @addtosaletable=Sale.create(:email=>current_user.email, :user_id=>current_user.id, :amount=>@amount, :stripe_id=>customer.id,\n :stripe_token=>params[:stripeToken], :picture_id=>params[:picture_id], :size=>params[:size], :address=>params[:address], :country=>params[:country], :postal_code=>params[:postal_code], :card_expiration=>Date.new(charge.card.exp_year,charge.card.exp_month,1) )\n \n end", "def create_stripe_payment_method(card_number)\n payment_method.gateway.request do\n Stripe::PaymentMethod.create({\n type: 'card',\n card: {\n number: card_number,\n exp_month: 12,\n exp_year: (Time.zone.now.year + 1),\n cvc: '123',\n },\n })\n end\n end", "def create\n customer = Stripe::Customer.create({\n :description => current_user.id,\n :email => current_user.email,\n :card => params[:stripeToken],\n })\n\n current_user.stripe_id = customer.id\n current_user.save!\n\n Stripe::Charge.create(\n :customer => current_user.stripe_id,\n :amount => 250,\n :description => 'Fantasy Rocket Monthly Subscription',\n :currency => 'usd',\n )\n\n current_user.create_subscription!\n redirect_to params[:redirect_to] || root_url, notice: \"Thanks! You're now subscribed.\"\n rescue Stripe::CardError => e\n redirect_to new_subscriptions_url, alert: e.message\n end", "def new\n @credit_card = ActiveMerchant::Billing::CreditCard.new\n end", "def create_the_payment_exhibition\n if((params[:invoicing_info][:payment_medium] == \"visa\") or (params[:invoicing_info][:payment_medium] == \"paypal\") or (params[:invoicing_info][:payment_medium] == \"master_card\")) \n credit_card = CreditCard.find_by_user_id(current_user.id)\n if credit_card.blank?\n credit_card = CreditCard.new()\n end\n credit_card.number = params[:credit_card][:number0]+params[:credit_card][:number1]+params[:credit_card][:number2]+params[:credit_card][:number3]+params[:credit_card][:number4]+params[:credit_card][:number5]+params[:credit_card][:number6]+params[:credit_card][:number7]+params[:credit_card][:number8]+params[:credit_card][:number9]+params[:credit_card][:number10]+params[:credit_card][:number11]+params[:credit_card][:number12]+params[:credit_card][:number13]+params[:credit_card][:number14]+params[:credit_card][:number15]\n credit_card.user_id = current_user.id\n credit_card.first_name = params[:credit_card][:first_name]\n credit_card.last_name = params[:credit_card][:last_name]\n credit_card.expiring_date = Date.civil(params[:credit_card][\"expiring_date(1i)\"].to_i,params[:credit_card][\"expiring_date(2i)\"].to_i,params[:credit_card][\"expiring_date(3i)\"].to_i).strftime(\"%y-%m-%d\") \n credit_card.save\n else\n end \n creditcardnumber = params[:credit_card][:number0]+params[:credit_card][:number1]+params[:credit_card][:number2]+params[:credit_card][:number3]+params[:credit_card][:number4]+params[:credit_card][:number5]+params[:credit_card][:number6]+params[:credit_card][:number7]+params[:credit_card][:number8]+params[:credit_card][:number9]+params[:credit_card][:number10]+params[:credit_card][:number11]+params[:credit_card][:number12]+params[:credit_card][:number13]+params[:credit_card][:number14]+params[:credit_card][:number15]\n #######################################this is im copying here is something from payment controller create method\n @order = session[:purchasable] \n if @order.blank?\n render :text =>\"Please Refresh The Page And Try Again\"\n return\n else \n @order.save\n current_user.profile.biography = params[:biography]\n current_user.profile.save\n end\n @current_object = Payment.new(params[:payment])\t\t#@invoice = session[:invoice]\t\t\n \n if @order.instance_of? ExhibitionsUser\n @current_object.amount_in_cents =params[:invoice_amount].to_i*100\n elsif @order.instance_of? CompetitionsUser\n @current_object.amount_in_cents = (@order.find_price(@order.competition.id) ) * 100\n else \n end\n @current_object.user = @current_user\t\t#@current_object.invoice = @invoice\n if @order.instance_of? ExhibitionsUser\n if params[:invoicing_info][:payment_medium] == \"visa\" or params[:invoicing_info][:payment_medium] == \"master_card\" \n @current_object.common_wealth_bank_process((params[:invoice_amount].to_i*100),params,creditcardnumber)\n \n elsif params[:invoicing_info][:payment_medium] == \"cash\" or params[:invoicing_info][:payment_medium] == \"cheque\" or params[:invoicing_info][:payment_medium] == \"direct deposit\"\n elsif params[:invoicing_info][:payment_medium] == \"paypal\" \n #@current_object.make_paypal_payment((params[:invoice_amount].to_i),params) \n session[:paypal_amount] = params[:invoice_amount].to_i*100\n set_the_token#from here i need to redirect him to paypal after getting the token\n session[:invoice_id] = params[:invoice_id]\n session[:order] = @order\n session[:exhibition_id] = @order.exhibition.id\n session[:current_object_id] = @current_object\n render :update do |page|\n page[\"modal_space_answer\"].hide \n page[\"paypal_form\"].replace_html :partial=>\"paypal_form\",:locals=>{:token =>@token,:amt=>params[:invoice_amount].to_i}\n page.call 'submit_my_form'\n end\n return\n end\n elsif @order.instance_of? CompetitionsUser\n if @order.invoices.last \n total_amount = 0\n @order.invoices.each {|x| total_amount = total_amount + x.final_amount}\n if total_amount < @order.find_price(@order.competition.id) \n more_amount = (@order.find_price(@order.competition.id) ) - total_amount\n @current_object.amount_in_cents = more_amount * 100\n if params[:invoicing_info][:payment_medium] == \"visa\" or params[:invoicing_info][:payment_medium] == \"master card\" \n @current_object.common_wealth_bank_process((more_amount * 100),params)\n elsif params[:invoicing_info][:payment_medium] == \"cash\" or params[:invoicing_info][:payment_medium] == \"cheque\" or params[:invoicing_info][:payment_medium] == \"direct deposit\"\n elsif params[:invoicing_info][:payment_medium] == \"paypal\" \n @current_object.make_paypal_payment((more_amount * 100),params) \n end\n else\n render :text=>\"You Did not changed the entry field or if you decremented it then send email to admin \"\n return\n end \n else\n if params[:invoicing_info][:payment_medium] == \"visa\" or params[:invoicing_info][:payment_medium] == \"master card\" \n @current_object.common_wealth_bank_process(((@order.find_price(@order.competition.id) ) * 100),params)#payment is done if invoice is not yet created. for competition user\n elsif params[:invoicing_info][:payment_medium] == \"cash\" or params[:invoicing_info][:payment_medium] == \"cheque\" or params[:invoicing_info][:payment_medium] == \"direct deposit\"\n elsif params[:invoicing_info][:payment_medium] == \"paypal\" \n @current_object.make_paypal_payment(((@order.find_price(@order.competition.id) ) * 100),params) \n end \n end \n else #here it may be come that while working in this method and it fails somewhere and session[:purchasable] = nil. generaly this is not the normal case\n if @order.instance_of? Order\n make_order_payment\n return\n else\n render :text=>\"There Is Internal Error While Making the payment Please Try Go Back And Try Again<a href='/admin/profiles/#{current_user.id}'>Back</a> \"\n end\n return\n end#bank procedure if end\n\t\t#here after the payment is done what message is required to be sent is get decided and the invoice is get generated\n if @current_object.state == 'online_validated'\t # flash[:notice] = 'Your Payment Is Done And Invoice Will Be Sent To You By Email'\n if @order.instance_of? CompetitionsUser \n if @order and @order.invoices.last\n total_amount = 0\n @order.invoices.each {|x| total_amount = total_amount + x.final_amount}\n if total_amount < @order.find_price(@order.competition.id) \n make_the_payment\n render :partial=>\"extra_payment_done\",:locals=>{:competition=>@order.competition,:order=>@order} \n return \n else\n # flash[:error] = \"Your Payment Is Already Done Please Go To Home Page <a href='/admin/competitions/#{@order.competition.id}'>Go Back To see the competition</a>\"\n end\n render :text => @template.blank_main_div(:title => 'System error', :hsize => 'sixH', :modal => true), :layout => false\n return\n else \n make_the_payment\n end\n else\n if @order.instance_of? ExhibitionsUser \n make_the_payment_exhibition\n end\n end \n if @order.instance_of? ExhibitionsUser \n \n if params[:invoicing_info][:payment_medium] == \"cash\" or params[:invoicing_info][:payment_medium] == \"cheque\" or params[:invoicing_info][:payment_medium] == \"direct deposit\"\n render :text=>\"After Your Payment Is Done Admin Will Validate You. After That Your Artwork Will Be Selected. <a href='/admin/exhibitions/#{@order.exhibition.id}'>Select Artwork</a>\"\n else\n invoice = Invoice.find(:last,:conditions=>[\"purchasable_type = ? and client_id = ? and purchasable_id = ?\",\"ExhibitionsUser\" , @order.user,@order.id])\n \n if invoice.state == \"created\"\n alreadypaidamt = @order.price - invoice.final_amount\n note = \"no notes created\"\n note = @order.exhibition.timing.note if @order.exhibition.timing\n create_pdf(invoice.id,invoice.number,@order.exhibition.timing.starting_date.strftime(\"%d %b %Y\"),invoice.client.profile.full_address_for_invoice,invoice.client.profile.full_name_for_invoice,@order.exhibition.title,@order.price.to_i,note,@order.price - alreadypaidamt,alreadypaidamt,true,@order.exhibition.timing.ending_date,\"\")\n QueuedMail.add('UserMailer','send_invoice_exhibition',[@current_object.user.profile.email_address,\"invoice#{invoice.id}\",\"Your Exhibition Payment Is Done And An Invoice Is Sent to Your Email.\",invoice, @current_object.user],0,true,@current_object.user.profile.email_address,\"test@pragtech.co.in\") \n end \n \n #render :text=>\"Your Payment Is Done Now Upload And Then Select The Artworks <a href='/admin/exhibitions/#{@order.exhibition.id}'>Select Artwork</a>\"\n #render :partial => \"online_response_exhibition_payment\",:locals=>{:exhibition_user_id=>@order.id,:artwork_count=>0}\n add_exhibition_artwork_insamediv\n\t\t\t \n end \n elsif @order.instance_of? CompetitionsUser\n if params[:invoicing_info][:payment_medium] == \"cash\" or params[:invoicing_info][:payment_medium] == \"cheque\" or params[:invoicing_info][:payment_medium] == \"direct deposit\"\n #render :text=>\"After Your Payment Is Done Admin Will Validate You. After That Your Artwork Will Be Selected. Please Make The Payment Before #{@order.submission_date} <a href='/admin/competitions/#{@order.competition.id}'>Go Back To see the competition</a>\"\n render :partial=> \"cash_cheque_response\",:locals=>{:competition_id=>@order.competition.id,:artwork_count=>0,:order_id=>@order.id,:total_entry=>@order.total_entry}\n else\n #session[:total_entry] = @order.total_entry\n #render :update do |page|\n # session[:store_for_submitting_the_artwork] = @order.id\n #page[\"show_me_the_error\"].replace_html :partial=>\"add_artwork_link\",:locals=>{:competition_id=>@order.competition.id,:artwork_count=>0,:order_id=>@order.id}\n #end\n render :partial=>\"add_artwork_link\",:locals=>{:competition_id=>@order.competition.id,:artwork_count=>0,:order_id=>@order.id}\n #render :text=>\"Your Payment Is Done . The Invoice Is Sent To You By Email. <a href='/admin/competitions/#{@order.competition.id}'>Go Back To see the competition</a>\"\n end \t \n end\n else\n if params[:invoicing_info][:payment_medium] == \"cash\" or params[:invoicing_info][:payment_medium] == \"cheque\" or params[:invoicing_info][:payment_medium] == \"direct deposit\"\n if @order.instance_of? CompetitionsUser\n make_the_payment\n else\n make_the_payment_exhibition\n invoice = Invoice.find(:last,:conditions=>[\"purchasable_type = ? and client_id = ? and purchasable_id = ?\",\"ExhibitionsUser\" , @order.user,@order.id])\n if invoice.state == \"created\"\n note = \"no notes created\"\n note = @order.exhibition.timing.note if @order.exhibition.timing\n senttime \n if invoice.sent_at\n senttime = invoice.sent_at.strftime(\"%d %b %Y\")\n else\n senttime = Time.now.strftime(\"%d %b %Y\")\n end\n \n \n create_pdf(invoice.id,invoice.number,senttime,invoice.client.profile.full_address_for_invoice,invoice.client.profile.full_name_for_invoice,@order.exhibition.title,invoice.final_amount.to_i,note)\n \n QueuedMail.add('UserMailer', 'send_invoice_exhibition', [invoice, @order.user], 0, true)\n end \n end \n if @order.instance_of? CompetitionsUser \n # render :text=>\"After Your Payment Is Done Admin Will Validate You. After That Your Artwork Will Be Selected. Please Make The Payment Before #{@order.competition.submission_deadline} <a href='/admin/competitions/#{@order.competition.id}'>Go Back To see the competition</a>\"\n render :partial=> \"cash_cheque_response\",:locals=>{:competition_id=>@order.competition.id,:artwork_count=>0,:order=>@order,:total_entry=>@order.total_entry}\n return \n else\n #exhibition cash_cheque_response\n # render :partial => \"cash_cheque_response_exhibition\",:locals=>{:exhibition_user_id=>@order.id,:artwork_count=>0}\n #instead of this response i need to give the option to add the artwork to user\n \n render :update do |page|\n page[\"add_the_artwork0\"].replace_html :partial=>\"add_the_artwork_exhibition\",:locals=>{:exhibition_user_id => @order.id,:exhibition_id=>@order.exhibition.id,:messageforimageuploaded=>\"After Your Payment Is Done Admin Will Validate You. Please Upload The Artwork\"}\n page[\"description_competition_ex_py\"].hide\n page[\"enterartworkcompetition\"].show\n page[\"add_the_artwork0\"].show\n page[\"iteam_image0\"].show\n page[\"iteam_image_uploaded\"].hide\n \n end\n #render :text=>\"After Your Payment Is Done Admin Will Validate You. After That Your Artwork Will Be Selected. <a href='admin/exhibitions/#{@order.exhibition.id}'>Select Artwork</a>\"\n end \t \n return\n end\n\t \n #flash[:error] = 'Error during the payment save '+@current_object.state.to_s\n\t \n #render :partial => 'new', :layout => false\n render :text=>\"Your payment has not been successful. Please check your details and try again\"\n end\n\n end", "def payment\n {\n :credit_card => credit_card\n }\n end", "def create\n @user = current_user\n @product = @event.title\n @amount = @event.price\n @stripe_amount = (@amount * 100).to_i\n begin\n customer = Stripe::Customer.create({\n email: params[:stripeEmail],\n source: params[:stripeToken],\n })\n charge = Stripe::Charge.create({\n customer: customer.id,\n amount: @stripe_amount,\n description: \"Achat d'un produit\",\n currency: 'eur',\n })\n rescue Stripe::CardError => e\n flash[:error] = e.message\n redirect_to new_order_path\n end\n end", "def create\n @Payment = Payment.new\n @Payment.user_id = current_user\n\n Stripe.api_key = ENV[\"STRIPE_API_KEY\"]\n token = params[:stripeToken]\n\n begin\n charge = Stripe::Charge.create(\n :amount => (25 * 100).floor,\n :currency => \"usd\",\n :card => token\n )\n flash[:notice] = \"Thanks for purchasing!\"\n rescue Stripe::CardError => e\n flash[:danger] = e.message\n end\n\n @Payment.stripe_id = charge.id\n @Payment.amount = charge.amount\n\n if current_user.subscribed != true\n current_user.subscribed = true\n current_user.credit = 25.00\n else\n current_user.credit = current_user.credit + 25.00\n end\n\n current_user.save\n redirect_to caves_path\n end", "def create_subscription\n subscription = nil\n stripe_call do\n local_plan = Plan.active.find(@params[:user][:plan_id])\n return false if local_plan.nil?\n stripe_plan = Stripe::Plan.retrieve(local_plan.stripe_id)\n # If the plan has a trial time, it does not need a stripe token to create a subscription\n # We assume you have a trial time > 0. Otherwise there will be 2 customers created for\n # each subscribed customer. One at registration and another when subscribing.\n subscription = customer.subscriptions.create(\n source: @params[:stripeToken],\n plan: stripe_plan.id\n )\n end\n return false if subscription.nil?\n\n user_attributes_to_update = {\n stripe_id: customer.id,\n stripe_subscription_id: subscription.id\n }\n assign_card_details(user_attributes_to_update, @params)\n @user.update(user_attributes_to_update)\n end", "def create_eob\n @insurance_payment_eob = InsurancePaymentEob.new(:details=>{:patient_first_name_ocr_output=>\"\"})\n @check_information.insurance_payment_eobs << @insurance_payment_eob\n @insurance_payment_eob.save(:validate => false)\n return @insurance_payment_eob\n end", "def purchase\n if express_token.include?(\"paykey=AP\")\n\n else\n\n #processes payment for express payment and on site with credit card.\n response = process_purchase\n #creates a transaction to store info from express payment and paywith Credit card\n transactions.create!(:action => \"purchase\", :amount => price_in_cents, :response => response)\n #cart.update_attribute(:purchased_at, Time.now) if response.success?\n response.success?\n end\n end", "def test_successful_purchase_with_emv_credit_card_in_uk\n assert response = @gateway.purchase(@amount, @emv_credit_cards[:uk], @options)\n assert_success response\n assert_equal 'charge', response.params['object']\n assert response.params['paid']\n assert_match CHARGE_ID_REGEX, response.authorization\n end", "def create\n s_params = params[:subscription]\n s_params.delete(:id)\n @subscription = Subscription.new(s_params)\n @subscription.save\n respond_with(@subscription)\n end", "def generate_account\n toll_free = @client.available_phone_numbers('US').toll_free.list(limit: 1)\n\n toll_free.each do |record|\n \n incoming_phone_number = @client.incoming_phone_numbers.create(phone_number: record.phone_number)\n\n puts incoming_phone_number.sid\n end\n\n \n end", "def create_card\n @card = Card.new(content_type_id: 3, content_id: self.id, created_by: self.created_by)\n if !@card.save\n raise ActiveRecord::RecordInvalid.new(self)\n end\n end", "def create_wepay_account\n if self.has_wepay_access_token? && !self.has_wepay_account?\n params = { :name => self.name, :description => self.description }\n response = WEPAY.call(\"/account/create\", self.wepay_access_token, params)\n\n if response[\"account_id\"]\n self.wepay_account_id = response[\"account_id\"]\n return self.save\n else\n raise \"Error - \" + response[\"error_description\"]\n end\n\n end\nraise \"Error - cannot create WePay account\"\nend", "def test_create_account\n an_account = OrderAccount.new\n \n an_account.order_user = order_users(:mustard)\n an_account.cc_number = \"|\n LzmzOb/JS+mFF72xts17cg==\n\"\n an_account.routing_number = \"\"\n an_account.bank_name = \"\"\n an_account.expiration_year = 4.years.from_now.year\n an_account.expiration_month = 1\n an_account.credit_ccv = \"\"\n an_account.account_number = \"\"\n\n assert an_account.save\n end", "def create_wepay_account\n if self.has_wepay_access_token? && !self.has_wepay_account?\n params = { :name => self.name, :description => \" User donate \" + self.donate_amount.to_s } \n response = WEPAY.call(\"/account/create\", self.wepay_access_token, params)\n\n if response[\"account_id\"]\n self.wepay_account_id = response[\"account_id\"]\n return self.save\n else\n raise \"Error - \" + response[\"error_description\"]\n end\n\n end \n raise \"Error - cannot create WePay account\"\nend", "def get_card_token\n card = Balanced::Card.new\n card.uri = \"/v1/marketplaces/TEST-MPv0uxteFANO0h9xY5c6Lrq/cards\"\n card.name = self.first_name + \" \" + self.last_name\n card.email = self.email\n card.card_number = \"4111111111111111\"\n card.expiration_month = \"10\"\n card.expiration_year = \"2020\"\n card.save.attributes[\"uri\"]\n end", "def create\n # params[:id] is the knowmadics id\n\n @api_subscription = Api::Subscription.new(api_subscription_params)\n\n respond_to do |format|\n if @api_subscription.save\n format.html { redirect_to @api_subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @api_subscription }\n else\n format.html { render :new }\n format.json { render json: @api_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_subscription!(plan, coupon, params)\n subscription = find_or_build_subscription(plan, coupon, params)\n subscription.save_with_payment!\n return subscription\n end", "def create_subscription(options)\n # Get the plan.\n plan = Stripe::Plan.retrieve(options[:plan])\n\n # Charge VAT in advance because subscription call will create and pay an invoice.\n # TK actually we need to apply VAT for invoiceitems that are pending and scheduled\n # for the next invoice.\n # Do not charge VAT if the plan or the subscription is still in trial (invoice will come later).\n vat, invoice_item = charge_vat_of_plan(plan) unless \\\n plan.trial_period_days || (options[:trial_end] && options[:trial_end] != 'now')\n\n # Start subscription.\n # This call automatically creates an invoice, always.\n subscription = customer.subscriptions.create(options)\n\n [subscription, last_invoice]\n rescue Stripe::StripeError, Stripe::CardError => e\n # Something failed in Stripe, if we already charged for VAT,\n # we need to rollback this. As we may charge twice later otherwise.\n invoice_item.delete if invoice_item\n raise e\n end", "def create_merchant email_address, merchant, bank_account_uri=nil, name=nil, meta={}\n account = Account.new(\n :uri => self.accounts_uri,\n :email_address => email_address,\n :merchant => merchant,\n :bank_account_uri => bank_account_uri,\n :name => name,\n :meta => meta,\n )\n account.save\n end", "def create_subscription\n session[:merchant_subscription_id] = 'User' + sprintf('%03d', rand(1000)) + 'Subscription' + sprintf('%04d', rand(10000))\n\n # prepare payload\n data = {\n :Amount => params[:product] == '1' ? 1.99 : 3.99,\n :Category => 1,\n :Channel => 'MOBILE_WEB',\n :Description => 'Word game 1',\n :MerchantTransactionId => session[:merchant_subscription_id],\n :MerchantProductId => 'wordGame1',\n :MerchantPaymentRedirectUrl => settings.subscription_redirect_url,\n :MerchantSubscriptionIdList => 'sampleSubscription1',\n :IsPurchaseOnNoActiveSubscription => 'false',\n :SubscriptionRecurringNumber => '99999',\n :SubscriptionRecurringPeriod => 'MONTHLY',\n :SubscriptionRecurringPeriodAmount => 1\n }\n\n response = RestClient.post settings.notary_app_sign_url, :payload => data.to_json\n from_json = JSON.parse response\n\n redirect settings.FQDN + \"/Commerce/Payment/Rest/2/Subscriptions?clientid=#{settings.api_key}&SignedPaymentDetail=#{from_json['signed_payload']}&Signature=#{from_json['signature']}\"\nend", "def create\n @subs_payment = SubsPayment.new(subs_payment_params)\n\n respond_to do |format|\n if @subs_payment.save\n format.html { redirect_to @subs_payment, notice: 'Subs payment was successfully created.' }\n format.json { render :show, status: :created, location: @subs_payment }\n else\n format.html { render :new }\n format.json { render json: @subs_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "def subscription_params\n params.require(:subscription).permit(:user_id, :plan_id, :last_4, :card_type, :coupon_id, :stripe_card_token)\n end", "def subs_payment_params\n params.require(:subs_payment).permit(:subscription_id, :customer_number, :network, :payment_type, :transaction_id, :amount, :trans_type, :reference, :callback_url, :status, :trans_status, :trans_ref,:card_name,:card_email)\n end", "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.activity :params => {:composite_key => \"#{@subscription.game_id},#{@subscription.player_id}\"}\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription.game, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_successful_purchase_with_solo_card\n response = @gateway.purchase(@amount, @solo, @params)\n assert_success response\n end", "def create\n @card = Card.new(card_params)\n # todo violation\n @wallet.cards << @card\n respond_to do |format|\n if @wallet.save\n format.html { redirect_to wallet_path, notice: 'Card was successfully created.' }\n format.json { render json: @wallet, status: :ok, location: wallet_path }\n else\n format.html { render :new }\n format.json { render json: @card.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_account(xml, credit_card)\n xml.Account do\n xml.Holder credit_card.name\n xml.Number credit_card.number\n xml.Brand credit_card.brand.upcase\n xml.Expiry(:month => credit_card.month, :year => credit_card.year)\n xml.Verification credit_card.verification_value\n end\n end", "def subscription_payment\n\n\n @sub = Subscription.where(return_token: params[:id]).first\n\n @amount = 0\n if @sub.subscription_type = \"Standard\"\n @amount = 3\n end\n \n if @sub.subscription_type = \"Pro\"\n @amount = 5\n end\n\n if @sub.subscription_type = \"Enterprise\"\n @amount = 10\n end\n\n @sub.payment_status = \"Paid\"\n @sub.save\n\n @sub_payment = SubscriptionPayment.new\n @sub_payment.subscription_type = @sub.subscription_type\n @sub_payment.amount = @amount\n @sub_payment.date_from = @sub.date_from\n @sub_payment.date_to = @sub.date_to\n @sub_payment.payment_for = \"Subscription\"\n @sub_payment.subscription_id = @sub.id\n @sub_payment.payment_date = Date.today\n\n @sub_payment.save\n\n redirect_to :controller => 'backend', :action => 'dashboard'\n\n end", "def create_card_from_hash(c)\n card = set_card_details(Card.new, c)\n card.save!\n card\nend", "def create_offer\n end", "def stripe_create(options)\n begin\n charge = Stripe::Charge.create({\n :amount => options[:amount],\n :currency => \"usd\",\n :capture => false,\n :description => \"Order Number #{options[:order_id]}\",\n :source => {\n :exp_month => options[:exp_month],\n :exp_year => options[:exp_year],\n :number => options[:card_number],\n :cvc => options[:cvc],\n :name => options[:full_name],\n :address_zip => options[:zip_code]\n }\n })\n self.update(:stripe_charge_id => charge[:id], :gateway => \"stripe\")\n \n if charge[:status] == \"succeeded\"\n self.update(:status => :authorized)\n return true\n else\n self.update(:status => :failed, :response_message => charge[:failure_message])\n return false\n end\n rescue Stripe::CardError => e\n self.update(:status => :failed, :response_message => e.message)\n return false\n rescue Stripe::StripeError => e\n self.update(:status => :failed, :response_message => e.message)\n return false\n end\n end", "def registerCard\n parameters={user_id: (@current_user[\"id\"]).to_i, number: (params[:number]).to_i, amount: (params[:amount]).to_i, expiration_month: (params[:expiration_month]).to_i, expiration_year: (params[:expiration_year]).to_i}\n puts (parameters)\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.104:3003/credit_cards\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n end", "def create_card(address_book_id, card_uri, card_data)\n end", "def create\n @transaction = Transaction.new(transaction_params)\n\n # TODO: Maybe not this here\n @transaction.payment_method_token = @transaction.saved_card.token if @transaction.saved_card\n\n ##### TODO: Cleanup\n if @transaction.valid?\n if @transaction.purchase_via_pmd?\n spreedly_transaction = deliver_to_receiver(@transaction)\n else\n spreedly_transaction = spreedly_env.purchase_on_gateway(\n ENV['gateway_token'],\n @transaction.payment_method_token,\n @transaction.amount * 100,\n retain_on_success: @transaction.save_card?\n )\n end\n\n if spreedly_transaction.succeeded?\n @transaction.transaction_token = spreedly_transaction.token\n\n notice_msg = 'Enjoy your flight!'\n notice_msg << ' You purchased this using PMD.' if @transaction.purchase_via_pmd?\n\n if @transaction.saved_card\n notice_msg << ' You used a saved card to pay for this.'\n elsif @transaction.save_card?\n notice_msg << ' Your card has been saved for future purchases!'\n credit_card = spreedly_env.find_payment_method(@transaction.payment_method_token)\n\n @transaction.build_saved_card(\n last_four_digits: credit_card.last_four_digits,\n card_type: credit_card.card_type,\n token: credit_card.token\n )\n end\n\n @transaction.save!\n redirect_to transactions_path, notice: notice_msg\n else\n @saved_cards = SavedCard.all\n flash.now[:notice] = spreedly_transaction.message\n render :new\n end\n else\n @saved_cards = SavedCard.all\n render :new\n end\n end", "def create_stripe_customer(token)\n Stripe.api_key = 'sk_test_xvxhe0dUKfbGI2MJOWOg1N8j'\n\n begin \n customer = Stripe::Customer.create(\n card: token,\n description: self.email\n )\n\n self.update(stripe_customer_id: customer.id)\n rescue Stripe::CardError => e\n flash[:error] = e.message\n redirect_to sub_request_path\n end\n end", "def purchase_with_card!\n puts 'purchase_with_card!'\n unless validate_card \n puts 'card invalid'\n puts 'calling err'\n err!\n puts 'state'\n puts self.state\n puts 'saving...'\n self.save!\n puts 'saved. state is'\n puts self.state\n puts 'valid?'\n puts self.valid?\n puts self.errors.full_messages\n return false \n end\n \n mode = self.account.gateway.mode\n gateway = self.account.gateway.authorize_net\n \n response = gateway.purchase(price_in_cents, credit_card, purchase_options)\n transactions.create!(:action => \"purchase\", \n :amount => price_in_cents, \n :response => response,\n :meth => 'card',\n :origin => 'web',\n :gateway_mode => mode)\n \n puts \"RESPONSE.success?\"\n puts response.success?\n \n if response.success?\n puts \"calling FINALIZE\"\n finalize!\n puts \"STATE\"\n puts state\n else\n puts \"calling ERR!\"\n err!\n puts 'STATE:'\n puts state\n end\n \n # response.success?\n end", "def create_subscription(options)\n # This call automatically creates an invoice, always.\n Stripe::Subscription.create({\n customer: customer.id,\n tax_percent: calculate_vat_rate\n }.merge(options))\n end", "def create_card_identifier(merchant_session_key, cardholder_name, card_number, expiry_date, security_code)\n payload = {\n \"cardDetails\" => {\n \"cardholderName\" => cardholder_name,\n \"cardNumber\" => card_number,\n \"expiryDate\" => expiry_date,\n \"securityCode\" => security_code\n }\n }\n http_call(:post, \"card-identifiers\", Opayo::Struct::CardIdentifier, nil, payload, merchant_session_key)\n end", "def test_create_recurring_profile\n response = @gateway.recurring(1000, @credit_card, :periodicity => :monthly)\n \n return if user_authentication_failed?(response)\n \n assert_success response\n assert !response.params['profile_id'].blank?\n assert response.test?\n end", "def card_params\n params.require(:card).permit(:id, :card_number, :security_type, :security_code, :expires_end)\n end", "def create\n response.headers[\"Content-Type\"] = \"text/javascript\"\n @card = @plan.cards.new(card_params)\n @card.save\n $redis.publish('messages.create', @card.to_json)\n end", "def postfill!(customer)\n self.price = customer.subscription.plan.amount / 100\n self.stripe_id = customer.id\n self.exp_month = customer.active_card.exp_month\n self.exp_year = customer.active_card.exp_year\n self.last4 = customer.active_card.last4\n self.status = \"active\"\n self.save!\n self\n end", "def create(price:, currency:, id:, frequency:, component_values: nil, rate_plan: nil, zone: nil, state: nil)\n basic_type_check(:price, price, Numeric)\n basic_type_check(:currency, currency, String)\n basic_type_check(:id, id, String)\n max_length_check(:id, id)\n valid_value_check(:frequency, frequency, VALID_FREQUENCIES)\n\n data = {price: price, currency: currency, id: id, frequency: frequency}\n\n unless component_values.nil?\n non_empty_array_check(:component_values, component_values)\n data[:component_values] = component_values\n end\n\n unless rate_plan.nil?\n non_empty_hash_check(:rate_plan, rate_plan)\n data[:rate_plan] = rate_plan\n end\n\n unless zone.nil?\n non_empty_hash_check(:zone, zone)\n data[:zone] = zone\n end\n\n unless state.nil?\n valid_value_check(:state, state, VALID_STATES)\n data[:state] = state\n end\n\n cf_post(path: \"/zones/#{zone_id}/subscription\", data: data)\n end", "def subscription_params\n params.require(:subscription).permit(:paypal_customer_token, :paypal_payment_token, :paypal_recurring_profile_token,\n # Assosiations\n :account_id, :user_id, :plan_id )\n end", "def create_stripe_card(stripe_card_hash)\n attrs = {purchase: self,\n stripe_object: stripe_card_hash[:object],\n stripe_type: stripe_card_hash[:type]}\n [:country, :cvc_check, :exp_month, :exp_year, :last4].each do |key|\n attrs[key] = stripe_card_hash[key]\n end\n self.stripe_card = Shopping::StripeCard.new(attrs)\n end", "def process_payment_unlimitess\n customer = Stripe::Customer.create email: email, card: token\n update_stripe_customer_id(customer)\n Stripe::Subscription.create customer: customer.id,\n items: [\n {price: 'price_1IndU1Bje2Voz8401SdrQuM0'},\n ]\n\n# customer = Stripe::Customer.create email: email, card: token\n# Stripe::Charge.create customer: customer.id,\n# amount: 10000,\n# description: 'Premium',\n# currency: 'usd'\n end", "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n record_activity :create, @subscription\n format.html { redirect_to edit_subscription_path(@subscription),\n notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_52_card_deck\n\n end", "def create\n @purchase = Purchase.new purchase_attributes\n if @purchase.save\n @ok = true\n renewed = Purchase.find_by_id params[:renewed_id]\n if renewed\n renewed.users.each do |u|\n u.purchase_id = @purchase.id\n u.save\n Notification.send_to(\n u.id,\n I18n.t('notifications.account.renewed.title'),\n I18n.t('notifications.account.renewed.message', :expiration_date => TimeConvert.to_string(@purchase.expiration_date)),\n ''\n )\n end\n renewed.expiration_date = Time.zone.now\n renewed.save\n end\n else\n @ok = false\n @errors = @purchase.errors.messages.keys\n @errors << :ssn_code if @errors.include?(:base)\n end\n end", "def card_params\n params.require(:card).permit(:cc, :xmonth, :xyear, :expiration_date)\n end", "def create\n @payment = Payment.new(payment_params.merge(subscription: @subscription))\n\n respond_to do |format|\n if @payment.save\n format.html { redirect_to admin_room_subscription_payment_path(id: @payment.id, subscription_id: @subscription.id), notice: t('.created') }\n format.json { render :show, status: :created }\n else\n format.html { render :new }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end", "def credit_card_number; end", "def create_card\n raise StandardError, 'Cliente null' if @client.nil?\n # la instancia de card recibe como parametro el @client al que se le va asociar la tarjeta\n card = PayuLatam::Card.new(@client)\n # hay un metodo card_params que genera el objeto a enviar con los datos correctos\n # se asignan los params correctos para la peticion\n card.params.merge! card_params\n\n # intento de creacion de tarjeta\n card.create!\n # si todo bien\n if card.success?\n # se llena la variable @card con la instancia de la clase PayuLatam::Card\n @card = card\n\n # no me acuerdo XD\n @client.remove_cards\n \n # se agrega la tarjeta al array de tarjetas del usuario. Ojo este array esta en memoria no necesariamente\n # es el mismo array de payu\n @client.add_card( card.response )\n\n # la respuesta de creacion de payu solo incluye el token de la tarjeta, entonces\n # volvemos a consultar la info almacenada en payu para recibier un poco mas de detalle y almacenarlo\n _card = card.load(card.response['token'])\n # se crea un registro de payu_card con la info publica de la tarjeta y el token de payu de la tarjeta\n @current_user.payu_cards.create(token: @card.response['token'], last_4: _card['number'], brand: _card['type'])\n else\n raise StandardError, \"Error generando token de tarjeta: #{card.error}\"\n end\n end", "def create\n @vendor_subscription = VendorSubscription.new(vendor_subscription_params)\n\n respond_to do |format|\n if @vendor_subscription.save\n format.html { redirect_to @vendor_subscription, notice: 'Vendor subscription was successfully created.' }\n format.json { render :show, status: :created, location: @vendor_subscription }\n else\n format.html { render :new }\n format.json { render json: @vendor_subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_wepay_account\n\t if self.has_wepay_access_token? && !self.has_wepay_account?\n\t params = { :name => self.name, :description => \"Selling goods on Tradies \" }\t\t\t\n\t response = WEPAY.call(\"/account/create\", self.wepay_access_token, params)\n\n\t if response[\"account_id\"]\n\t \tputs \"need to get account_id\"\n\t \t\t# puts response['account_id']\n\t # self.wepay_account_id = response[\"account_id\"]\n\t return self.update_columns(wepay_account_id: response['account_id'])\n\t else\n\t raise \"Error - \" + response[\"error_description\"]\n\t end\n\n\t end\t\t\n\t raise \"Error - cannot create WePay account\"\n\tend", "def subscribe!\n Subscription.transaction do\n subscription = create_stripe_subscription!\n store.subscriptions.create!(\n customer: user,\n stripe_plan_id: stripe_plan_id,\n stripe_id: subscription.id,\n first_date: Date.today,\n status: :active\n )\n end\n end" ]
[ "0.74440676", "0.69249344", "0.66142", "0.6543828", "0.6535729", "0.6463699", "0.6438519", "0.63840294", "0.63840294", "0.63743496", "0.6366984", "0.6348669", "0.63290554", "0.6298875", "0.6294393", "0.6271813", "0.6244119", "0.621914", "0.62121296", "0.6211957", "0.6202277", "0.6180029", "0.6179465", "0.61772543", "0.6166395", "0.61642206", "0.61635244", "0.61436766", "0.60870236", "0.60763276", "0.60569984", "0.60516036", "0.60475177", "0.6036205", "0.6022763", "0.5996755", "0.5982763", "0.59624326", "0.59613734", "0.59500706", "0.59397846", "0.59231204", "0.59201914", "0.59136397", "0.58980435", "0.58855456", "0.58830523", "0.5877313", "0.58746874", "0.58729255", "0.5868751", "0.5857136", "0.5855636", "0.5853926", "0.5830833", "0.5824163", "0.58227205", "0.5813101", "0.5812327", "0.5800682", "0.57981336", "0.5791876", "0.5791022", "0.5789596", "0.5789372", "0.57889533", "0.57844114", "0.57790244", "0.5776211", "0.5770803", "0.5770007", "0.57693374", "0.5758631", "0.575609", "0.574554", "0.5742879", "0.5734638", "0.5726071", "0.5723379", "0.57198006", "0.5717022", "0.5716179", "0.571471", "0.570895", "0.57076144", "0.57019264", "0.56989723", "0.56922364", "0.5682802", "0.5682468", "0.5678057", "0.5677368", "0.5670632", "0.5667233", "0.5667051", "0.56633705", "0.5662836", "0.5655799", "0.56477445", "0.564418" ]
0.70539814
1
Locate whitelisted attributes for the supplied association name
def whitelisted_attrs_for(assoc_name, attr_hash = whitelisted_attrs) if assoc_name.to_s == attr_hash.keys.first.to_s return attr_hash.values.first.reject { |v| v.is_a? Hash } end scoped_whitelisted_attrs = attr_hash.values.first scoped_whitelisted_attrs.reject { |v| !v.is_a? Hash }.find { |v| whitelisted_attrs_for(assoc_name, v) }.try(:values).try(:first) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_attributes_starting_with(name)\n @attributes.select { |key| key.to_s.start_with?(name) }\n end", "def with(name)\r\n @attributes.find { |attr| attr.name == name }\r\n end", "def sanitize_has_many(association_name)\n association_name = association_name.to_s\n singular_name = association_name.singularize\n nested_name = \"#{association_name}_attributes\"\n klass = association_name.singularize.camelize.constantize\n remap singular_name => nested_name\n remap association_name => nested_name\n ensure_array nested_name\n sanitize_nested_attributes nested_name => klass\n end", "def attribute(name)\n @allowed_attributes[name]\n end", "def permitted?(attribute_name)\n resource.fields_array.include?(attribute_name.to_sym) ||\n permitted.include?(attribute_name.to_sym)\n end", "def crosswalk_attr?(attr_name, access_by: nil)\n attr_name = attr_name.to_sym\n crosswalk_attrs(access_by: access_by).include?(attr_name)\n end", "def find_attribute_named(name)\n case name\n when /\\A#/ then\n find_attribute name[1..-1], false\n when /\\A::/ then\n find_attribute name[2..-1], true\n else\n @attributes.find { |a| a.name == name }\n end\n end", "def find_attributes(name)\n\t\t\tr=[]\n\t\t\tp=self\n\t\t\twhile(p)\n\t\t\t\tif(p.respond_to?(name))\n\t\t\t\t\tv=p.send(name)\n\t\t\t\t\tr << v if(v)\n\t\t\t\tend\n\t\t\t\tbreak if(!p.respond_to?(\"container\"))\n\t\t\t\tp=p.container\n\t\t\tend\n\t\t\tr\n\t\tend", "def find_attribute_named(name)\n @attributes.find { |m| m.name == name }\n end", "def attribute_present?(name)\n @ldap_entry.attribute_names.include?(name)\n end", "def attribute_with_param(attr_name, param_name)\n attributes = self.attributes[attr_name.downcase]\n found_attributes = attributes.select { |attribute| attribute.params[param_name.downcase] }\n found_attributes.first\n end", "def find_attribute(qualified_name, namespace, name)\n if qname = @qualified_attributes[qualified_name]\n return qname\n end\n names = []\n plural = collection?(qualified_name)\n if plural\n if namespace\n names << \"#{ namespace }_#{ name.pluralize }\"\n end\n names << name.pluralize\n end\n if namespace\n names << \"#{ namespace }_#{ name }\"\n end\n names << name\n names.map { |n| n.underscore }.find do |n|\n @attributes.include? n.underscore\n end\n end", "def has_attribute?( name )\n accessories.each do |acc|\n return true if acc.name == name\n end\n false\n end", "def association_name_attributes\n \"#{association_name}_attributes\"\n end", "def association_attr?(attr_name)\n !!attr_name.to_s.index(\"__\")\n end", "def _search_attributes\n _attrs.hmap do |name, settings|\n opts = settings[:options]\n next unless opts[:net_miner_search_path]\n [name, opts[:net_miner_search_path]]\n end\n end", "def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end", "def attributes(*attributes)\n @attributes.concat(attributes)\n @scope = @scope.includes(@scope.filter_associations(attributes))\n end", "def config_for(attr)\n permitted.find { |elem| elem[:attr] == attr.to_s }\n end", "def filtered_by_association(name, instance)\n instance.present? ? where(\"#{name}_key\" => \"#{instance.class.name}#{ActivityNotification.config.composite_key_delimiter}#{instance.id}\") : where(\"#{name}_key.null\" => true)\n end", "def reflect_on_association(name)\n association_by_name[name.to_sym]\n end", "def possible_attributes\n custom_keys = valid_criteria.keys.sort\n klass = population.populatable.class.reflect_on_association(population.starting_set.try(:to_sym)).try(:class_name).try(:constantize) rescue nil\n p_codes = []; ap_codes = []\n if klass\n p_codes = klass::PLACEHOLDER_CODES || [] rescue []\n ap_codes = []\n for assoc in (klass::PLACEHOLDER_ASSOCIATIONS || [] rescue [])\n aklass = klass.reflect_on_association(assoc.to_sym).try(:class_name).try(:constantize)\n ap_codes << aklass::PLACEHOLDER_CODES.collect{|c| \"#{assoc}.#{c}\"} if aklass rescue nil\n end\n end\n all_keys = ((custom_keys + p_codes).flatten.sort + ap_codes.sort).flatten.compact.uniq.map{|k| [k.gsub(\"_\", \" \").gsub(\".\", \" → \"), k]}\n end", "def assoc_searchable(*args)\n opts = args.extract_options!\n args.flatten.each do |assoc|\n assoc = assoc.to_s\n raise(ArgumentError, \"No such association #{assoc} in #{self}\") unless self.reflect_on_all_associations.map {|a| a.name.to_s}.include?(assoc)\n self._metasearch_include_associations = self._metasearch_include_associations.merge(\n assoc => {\n :if => opts[:if]\n }\n )\n end\n end", "def validates_inclusion_of_for(*attr_names)\n configuration = { :on => :save }\n configuration.update(attr_names.extract_options!)\n\n enum = configuration[:in] || configuration[:within]\n\n raise(ArgumentError, \"An object with the method include? is required must be supplied as the :in option of the configuration hash\") unless enum.respond_to?(:include?)\n\n validates_each(attr_names, configuration) do |record, attr_name, value|\n unless enum.include?(value)\n attr_for = configuration[:for] || attr_name\n record.errors.add(attr_for, :inclusion, :default => configuration[:message], :value => value) \n end\n end\n end", "def dangerous_attribute?(name)\n attribute_methods(name).detect do |method_name|\n allocate.respond_to?(method_name, true)\n end unless attribute_names.include? name.to_s\n end", "def has_attribute?(name)\n attribute_names.include?(name.to_str)\n end", "def check_for_hidden_nested_attributes(name, value)\n name_sym = name.to_sym\n\n reflection = self.class.reflect_on_association(name_sym)\n\n if reflection\n if reflection.has_many? && value.is_a?(Array)\n hash = {}\n value.each_with_index do |_value, index|\n hash[index.to_s] = _value\n end\n value = hash\n end\n name = \"#{name}_attributes\"\n end\n\n [name, value]\n end", "def association(association_name); end", "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "def find_identities_by_attribute_name(operation_name)\n# o = Attribute.find_by_content(operation_name)\n# o = Attribute.where(:content => operation_name)\n ret = []\n# unless o.nil?\n ret = self.identities.reject {|i| not i.attributes.include? i.attributes.find_by_content(operation_name)}\n# end\n return ret\n end", "def has_association?(attr_name)\n _associations.has_key?(attr_name.to_sym)\n end", "def attribute_lookup(attribute_name)\n a = nil\n @current_relation.attributes.each do |attribute|\n return attribute if attribute.name == attribute_name\n end\n a\n end", "def custom_constrained_attributes\n collect_attributes { |element_name, attrdef| attrdef.custom == \"true\" && attrdef.constrained == \"true\" }\n end", "def find_in_extended_attr( m_name )\n schema = find_attr_in_schema( m_name )\n self.extended_attributes.find_by_extended_attributes_schema_id( schema.id ) unless schema.blank?\n end", "def proxyable_attributes\n return proxyable.proxyable_attributes if proxyable.respond_to?(:proxyable_attributes)\n attribute_names = proxyable.attribute_names - ExcludedAttributes\n proxyable.attributes.select{ |key, value| attribute_names.include?(key) }\n end", "def find_association name\n associations.values.detect do |association|\n association.represents_sfdc_table? name\n end\n end", "def search_attributes\n\t\t['dn', self.attr_firstname, self.attr_lastname, self.attr_mail, self.attr_member]\n\tend", "def attribute?(name)\n self.attribute_names.include?(name.to_sym)\n end", "def assoc_unsearchable(*args)\n opts = args.extract_options!\n args.flatten.each do |assoc|\n assoc = assoc.to_s\n raise(ArgumentError, \"No such association #{assoc} in #{self}\") unless self.reflect_on_all_associations.map {|a| a.name.to_s}.include?(assoc)\n self._metasearch_exclude_associations = self._metasearch_exclude_associations.merge(\n assoc => {\n :if => opts[:if]\n }\n )\n end\n end", "def filtered_attributes(keys,scope)\n case scope\n when :new\n %i( id date catalogs catalog_definitions treatments complete just_created )\n when :existing\n keys\n else\n keys - %i( catalog_definitions )\n end\n end", "def filter_attributes(attributes, to_filter)\n return nil if attributes.nil? || to_filter.nil?\n\n attributes.select { |key, _| to_filter.include? key.to_sym }\n end", "def where(params = {})\n return self if params.blank? && @owner.attributes[@name].blank?\n params = @klass.attribute_map.map(params, :to => :source)\n AssociationProxy.new self.clone.tap { |a| a.params = a.params.merge(params) }\n end", "def reflect_on_association(name)\n ActiveRecordAssociationAdapter.for_association(associations[name]) if associations[name]\n end", "def searchable_attribute_names\n if model.respond_to?(:searchable_alchemy_resource_attributes)\n model.searchable_alchemy_resource_attributes\n else\n attributes.select { |a| searchable_attribute?(a) }\n .concat(searchable_relation_attributes(attributes))\n .collect { |h| h[:name] }\n end\n end", "def check_predefined_atttributes\n send_ons = [0]\n\n send_ons << created_at_changed? ? 1 : 2\n\n predefiners = PredefinedAttribute.where(send_on: send_ons, table: 'users')\n\n predefiners.each do |predef|\n if self.send(predef.column) == predef.value\n predef.assign_values(self)\n end\n end\n end", "def search_attribute(attrib)\n unless attrib.blank?\n attrib = attrib.to_s.strip\n search_attributes.insert(0, attrib) unless search_attributes.include?(attrib)\n end\n end", "def method_missing(name, *args, &block)\n unless self.attributes.include?(name.to_s)\n super(name, *args, &block)\n else\n self.attributes[name.to_s]\n end\n end", "def method_missing(name, *args, &block)\n unless self.attributes.include?(name.to_s)\n super(name, *args, &block)\n else\n self.attributes[name.to_s]\n end\n end", "def has_attribute?(name)\n attributes.has_key?(name)\n end", "def external_id?(attr_name, access_by: nil)\n attr_name = attr_name.to_sym\n external_id_matching_fields(access_by: access_by).include? attr_name\n end", "def attr_associations\n @attr_associations\n end", "def loaded_attributes\n properties.map{|p| p.name if attribute_loaded?(p.name)}.compact\n end", "def association_from_relation_name(name)\n model_associations.detect { |a| a.name == name.to_sym }\n end", "def load_associated(name)\n return nil unless association_id = send(\"#{name}_id\")\n\n class_name = send(\"#{name}_type\") || config_class_name_for(name)\n klass = class_name.classify.constantize\n\n primary_key = config_primary_key_for(name) || klass.primary_key\n\n klass.where(primary_key => association_id).first\n end", "def _pick_attribute(names)\n [names].flatten.each do |name|\n return self.send(name) if self.respond_to?(name)\n end\n return nil\n end", "def find_attribute_of_model_in_hash(hash, model_name, attribute_name)\n\n if model_hash = hash[\"models\"] && hash[\"models\"][model_name]\n\n result = (model_hash[\"attributes\"] || []).find { |name, type| name.reject{ |key, _| key == \"options\"}.to_a.flatten.first == attribute_name } # TODO this will change because the attribute list will become an hash again\n return result.reject{ |key, _| key == \"options\"}.to_a.flatten if result # Remove the options part of the attribute, this will be unnecessary when the yaml structure is changed\n \n elsif namespaces = hash[\"namespaces\"]\n namespaces.each do |namespace, namespace_hash|\n result = find_attribute_of_model_in_hash(namespace_hash, model_name, attribute_name)\n return result unless result.nil?\n end\n end\n \n # Nothing found\n nil\n end", "def safe_attribute_names(role = nil)\n role = safe_attributes_role(role)\n \n names = []\n self.class.safe_attributes.collect do |attrs, options|\n next unless options[:as].empty? or options[:as].include?(role)\n next unless options[:if].nil? or safe_attrs_call(options[:if], role)\n next unless options[:unless].nil? or !safe_attrs_call(options[:unless], role)\n\n names += attrs.collect(&:to_s)\n end\n names.uniq\n end", "def filter_attributes(attrs)\n attributes = attrs.each_with_object({}) do |name, inst|\n next unless validates?(name)\n inst[name] = get_field(name)\n end\n\n optional_fields = _optional\n if optional_fields.present?\n optional_fields.each do |field|\n next unless validates?(field)\n attributes[field] = get_field(field)\n end\n end\n\n associated_fields = _associations\n if associated_fields.present?\n associated_fields.each do |assoc|\n next unless validates?(assoc)\n attributes[assoc] = get_association(assoc)\n end\n end\n\n attributes\n end", "def filter_by attributes\n\n all.select { |item| matches? item, attributes }\n\n end", "def assignable_attribute_names\n stored_attributes = object.attribute_names.select &method(:permitted?)\n transient_attributes = permitted.select do |attribute_name|\n check_method(\"#{attribute_name}=\")\n true\n end.map(&:to_s)\n stored_attributes + transient_attributes\n end", "def attributes\n restricted = defined?(self.class::NON_ATTRIBUTE_PARAMS) ? self.class::NON_ATTRIBUTE_PARAMS : []\n (self.class::PARAM_DEFAULTS.keys - restricted).index_with { |attr| send(attr) }.with_indifferent_access\n end", "def filter_properties(properties, whitelist); end", "def find_attribute(name, singleton)\n name = $1 if name =~ /^(.*)=$/\n @attributes.find { |a| a.name == name && a.singleton == singleton }\n end", "def permitted\n {attrib_name => spec.permitted}\n end", "def scaffold_filter_attributes(action, attributes)\n allowed_attributes = scaffold_attributes(action).collect{|x| x.to_s}\n attributes.reject{|k,v| !allowed_attributes.include?(k.to_s.split('(')[0])}\n end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def scaf_find_all_available_items_to_association( assoc )\n assoc.klass.find(:all)\n end", "def needed_attributes\n selected_attr_trackers.collect { |ready_or_needed| ready_or_needed.to_s.match /(.*)_needed$/ ; $1&.to_sym }.compact\n end", "def method_missing(name, *args, &block)\n return attributes[name.to_sym] if attributes.include?(name.to_sym)\n return super\n end", "def include_attrs\n @include_attrs\n end", "def attribute?(name)\n @attrs.has_key(name)\n end", "def all_attributes_exists?(attribute_names)\n attribute_names.reduce(true) {|result, att| ALL_FIELDS.include? att or SUPPORTED_ALTS.include? att}\n end", "def attr_searchable(*args)\n if table_exists?\n opts = args.extract_options!\n args.flatten.each do |attr|\n attr = attr.to_s\n raise(ArgumentError, \"No persisted attribute (column) named #{attr} in #{self}\") unless self.columns_hash.has_key?(attr)\n self._metasearch_include_attributes = self._metasearch_include_attributes.merge(\n attr => {\n :if => opts[:if]\n }\n )\n end\n end\n end", "def attribute?(name)\n name[0] != ?_ && property?(name)\n end", "def exclude_attrs(hash, attrs, must_exclude, associations)\n exclude = attrs + associations + must_exclude\n hash.except(*exclude)\n end", "def all_associations_exist?(association_names)\n\t\t\t\tassociation_names.all? do |name| \n\t\t\t\t\tfound_reflection = find_reflection( extract_association(name) )\n\t\t\t\t\tfound_reflection && !(name.to_s.include?(\"_id\") && (found_reflection.macro == :belong_to) ) # TODO very hacky, make it work together with rails scoped_by\n\t\t\t\tend\n\t\t\tend", "def sanitize_association(assoc, sanitizer_info)\n current_data = self.metadata[assoc]\n return unless current_data.is_a?(Array)\n self.metadata[assoc] = current_data.map do |item|\n sanitize_item(item, sanitizer_info)\n end\n end", "def associate(type, assoc_name, opts=OPTS)\n if !opts[:is_used] && @unused_associations_data && (data = @unused_associations_data[name]) && data[assoc_name.to_s] == 'unused'\n return\n end\n \n super\n end", "def include_attr?(key)\n @attrs_hash.include?(key.intern)\n end", "def association_reflection(name)\n association_reflections[name]\n end", "def included_attributes\n @included_attributes ||= begin\n ret = self.options[:include_extras] || []\n ret.map(&:to_sym)\n end\n end", "def associate_existing_records(association_name, attributes_collection)\n\n # determine existing records, bail if there are none specified by 'id'\n attribute_ids = attributes_collection.map {|a| (a['id'] || a[:id]) }.compact\n return if attribute_ids.empty?\n\n association = association(association_name)\n primary_key = association.klass.primary_key.to_sym\n\n # get known existing ids on the association\n existing_record_ids = if association.loaded?\n association.target.map(&primary_key)\n else\n association.scope.where(primary_key => attribute_ids).pluck(primary_key)\n end\n\n # unassociated records are those that are not part of existing in the association\n unassociated_record_ids = attribute_ids.map(&:to_s) - existing_record_ids.map(&:to_s)\n\n # we are about to set all foreign_keys, remove any foreign_key references in\n # unassigned records attributes so they don't get clobbered\n attributes_collection.map do |a|\n if unassociated_record_ids.include?((a['id'] || a[:id]).to_s)\n key = association.reflection.foreign_key\n a.delete(key) || a.delete(key.to_sym)\n end\n end\n\n # concat the unassociated records to the association\n association.concat(association.klass.find(unassociated_record_ids))\n end", "def ignore_attributes(*attributes)\r\n @@ignored_attributes[name] = attributes.flatten.map(&:to_s)\r\n end", "def attribute(name)\n @attributes ||= {}\n @attributes[name]\n end", "def find_user_profile_attribute_definition(name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" User Profile Attribute Definition\")\n get(\"#{@api_url}/userProfileAttributeDefinitions/#{encode(name)}\", params, headers)\n end", "def find_relationship_by(attribute, value); end", "def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_sym)\n end", "def has_attributes?(names)\n parts = composite_parts\n names.all?{|k| parts.key?(k)}\n end", "def filtered_attributes\n # Run the read permission check\n allow_and_deny_fields(:read).then do |allow, deny|\n\n result = nil\n\n if allow && allow != true && allow.size > 0\n # always keep id\n allow << :id\n\n # Only keep fields in the allow list\n result = @attributes.select { |key| allow.include?(key) }\n elsif deny == true\n # Only keep id\n # TODO: Should this be a full reject?\n result = @attributes.reject { |key| key != :id }\n elsif deny && deny.size > 0\n # Reject any in the deny list\n result = @attributes.reject { |key| deny.include?(key) }\n else\n result = @attributes\n end\n\n # Deeply filter any nested models\n result.then do |res|\n keys = []\n values = []\n res.each do |key, value|\n if value.is_a?(Model)\n value = value.filtered_attributes\n end\n keys << key\n values << value\n end\n\n Promise.when(*values).then do |values|\n keys.zip(values).to_h\n end\n end\n end\n end", "def has_attribute?(attr_name)\n self.attribute_names.include?(attr_name.to_s)\n end", "def has_attribute?(name)\n current_attributes.has_key?(name)\n end", "def has_attribute?(name)\n @attributes.key?(name.to_s)\n end", "def validated_attribute_names(params); end", "def allowed_custom_attributes\n [\n token_sale_registered_attribute,\n token_sale_phase_attribute,\n token_sale_kyc_confirmed_attribute,\n token_sale_has_purchased_attribute,\n kyc_marketing_attribute,\n first_name_attribute,\n last_name_attribute,\n company_name_attribute,\n project_description_attribute,\n kit_marketing_attribute,\n name_poc_attribute,\n team_bio_attribute,\n video_url_attribute,\n url_blog_attribute,\n project_url_attribute,\n tech_doc_attribute,\n twitter_handle_attribute,\n organization_name_attribute\n ]\n end", "def special_attribute(name)\n @special_attributes[name]\n end", "def skipped_attributes(klass)\n if klass.const_defined?(BLACKLISTED_ATTRIBUTES)\n attrs = klass.const_get(BLACKLISTED_ATTRIBUTES)\n if attrs.include? klass_primary_key(klass)\n raise OptAR::Errors::PrimaryKeyBlacklistedError\n end\n attrs\n else\n []\n end\n end", "def search_by(aspect, name)\n self.all.select { |movie| movie.send(aspect).include?(name) }\n end", "def unused_preload_associations_for?(klazz, association)\n unused_preload_associations[klazz].present? && unused_preload_associations[klazz].include?(association)\n end", "def validate_inclusion_of_each(attribute_name, list, message = nil)\n value = send(attribute_name)\n value && value.each do |obj|\n unless list.include?(obj)\n append_error(value, message || :isnt_listed) \n break\n end\n end\n end" ]
[ "0.62297773", "0.58707494", "0.5681205", "0.56804436", "0.5580042", "0.55318826", "0.5509185", "0.543627", "0.54211015", "0.5367452", "0.53495026", "0.5342377", "0.52918595", "0.5263046", "0.52556527", "0.5253176", "0.51756036", "0.51753515", "0.5157375", "0.51460755", "0.51459473", "0.5135355", "0.51284444", "0.5124744", "0.51242644", "0.51124954", "0.5107113", "0.5077521", "0.50755787", "0.5057751", "0.505216", "0.5019511", "0.50072396", "0.50062823", "0.500324", "0.49974003", "0.49921656", "0.49814677", "0.4969676", "0.49601442", "0.4944497", "0.4940008", "0.49293068", "0.49215585", "0.49104646", "0.49010783", "0.4893801", "0.4893801", "0.48926285", "0.48853108", "0.48850214", "0.48782104", "0.4874297", "0.4873539", "0.487133", "0.48638076", "0.48629418", "0.48492151", "0.48359904", "0.48341283", "0.48234704", "0.48213407", "0.482075", "0.48187274", "0.48094562", "0.48081517", "0.48081517", "0.48004603", "0.47959757", "0.47943014", "0.47853547", "0.4779027", "0.477152", "0.47685507", "0.47683635", "0.47662103", "0.47660384", "0.4765099", "0.47534364", "0.47510353", "0.475059", "0.47383502", "0.47374055", "0.4735278", "0.47116536", "0.47113943", "0.47065687", "0.47016525", "0.47015417", "0.469935", "0.46979854", "0.46975702", "0.46974123", "0.46866682", "0.46853948", "0.46847117", "0.46843436", "0.4678476", "0.46772432", "0.46703577" ]
0.6263081
0
Returns true or nil
def nullify(bool) bool ? bool : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def null?; false end", "def success?() end", "def usable?; end", "def result?\n true\n end", "def result?\n false\n end", "def ok? \n @funct == nil ? (return false) : (return true)\n end", "def check ; true ; end", "def true(_argvs)\n return nil\n end", "def missing?; false; end", "def null?\n false\n end", "def null?\n false\n end", "def exists?; end", "def null?\n false\n end", "def test?\n false\n end", "def success?(*) end", "def nil?; false; end", "def null?\n false\n end", "def null?\n false\n end", "def null?\n false\n end", "def nil?() end", "def nil?() end", "def nil?\n return true\n end", "def single?; false; end", "def single?; false; end", "def nil?() true; end", "def to_bool() true end", "def null?\n true\n end", "def test?\n true\n end", "def simple?\n true\n end", "def aye?\n true\n end", "def success?\n return true\n end", "def one?\n true\n end", "def unknown?; false; end", "def unknown?; false; end", "def semact?; false; end", "def result_to_get?\n if not @result.nil?\n if @result.downcase == 'true'\n return true\n else\n return false\n end\n else\n return false\n end\n end", "def to_bool() false end", "def real?\n true\n end", "def qwerty\n\t\tfalse\n\tend", "def nd?\n true\n end", "def nil?\r\n false\r\n end", "def basic?\n false\n end", "def success?\n end", "def delicious?\n\t\treturn true\n\tend", "def null?\n true\n end", "def true \n \"true\" \n end", "def valid?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @metadata.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n end", "def simple_present; end", "def returns_nil; end", "def nil?\n false\n end", "def nil?\n false\n end", "def scm_null?; SCM_FALSE; end", "def isSatisfiable?()\n\tend", "def usable?\n false\n end", "def ordinary?\n raise \"Not implemented yet\"\n end", "def ok?\n @ok\n end", "def exists?\n\t\treturn false\n\tend", "def delicious?()\n\t\treturn TRUE\n\tend", "def nil?\n true\n end", "def nil?\n true\n end", "def always_true\n true\n end", "def single_value?\n return false\n end", "def open_status?\n return @ajar == true\n end", "def present?; end", "def available?\n return false\n end", "def delicious?\n #its automattically true\n true\n end", "def success?\n true\n end", "def none?; end", "def none?; end", "def none?; end", "def exist\n\treturn true\n end", "def success?()\n result != false\n end", "def atom?\n true\n end", "def success?\n @success\n end", "def working?\n \t@working\n end", "def check!\n true\n end", "def working?\n false\n end", "def value\n true\n end", "def ok?\n return @ok\n end", "def available?\n true\n end", "def ai?\n\ttrue\n end", "def success?\n false\n end", "def success?\n false\n end", "def broken?\n @broken == :broken \n\tend", "def client?() false; end", "def working?\n true\n end", "def working?\n true\n end", "def supports_is_true?\n false\n end", "def optional?\n @optional\n end", "def read_bool; end", "def result?; end", "def has_one?; false; end", "def has_one?; false; end", "def suitable?\n false\n end", "def suitable?\n false\n end", "def no? ; false ; end", "def truth?\n truth\n end", "def truth\n\t\t\t\"You can't handle the truth\" ; true\n\t\tend", "def to_bool; self; end", "def to_bool; self; end", "def used?\n true\n end" ]
[ "0.73527294", "0.71958756", "0.70889044", "0.7076888", "0.70721966", "0.7020699", "0.6976452", "0.6956316", "0.69526184", "0.6942693", "0.6942693", "0.69166285", "0.6899009", "0.6875169", "0.68494153", "0.6838159", "0.68375415", "0.6819223", "0.6819223", "0.680289", "0.680289", "0.67652464", "0.67578346", "0.67578346", "0.6744231", "0.6741072", "0.6720181", "0.6716808", "0.67072654", "0.6706206", "0.6681288", "0.6680449", "0.6676004", "0.6676004", "0.66713554", "0.6663329", "0.6660289", "0.66501755", "0.6638492", "0.66334724", "0.6615958", "0.6615173", "0.6612313", "0.6593124", "0.6579069", "0.65763235", "0.65590817", "0.65580213", "0.6554404", "0.65441287", "0.65441287", "0.6537461", "0.6533091", "0.6525424", "0.65239894", "0.6522774", "0.65209603", "0.6513566", "0.6511006", "0.6511006", "0.6508587", "0.650714", "0.6495697", "0.6493876", "0.6493745", "0.64895415", "0.6487742", "0.6483086", "0.6483086", "0.6483086", "0.64742553", "0.64723206", "0.6470477", "0.6468445", "0.6465682", "0.6464368", "0.6456879", "0.64558285", "0.645579", "0.6454386", "0.64478946", "0.6446125", "0.6446125", "0.6445657", "0.6440141", "0.6435108", "0.6435108", "0.643043", "0.64282584", "0.6424066", "0.64230835", "0.6422701", "0.6422701", "0.6418172", "0.6418172", "0.6412766", "0.6408436", "0.6407201", "0.6406725", "0.6406725", "0.6400111" ]
0.0
-1
num1 the first integer num2 the second integer Examples power(3, 2) => 9 Returns the value of the first integer to the power of the second one
def power(base, exponent) i = output = 1 while i <= exponent output = output * base i += 1 end return output end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def power (n1, n2)\n\tn = n1 ** n2\n\treturn n\nend", "def power(n1, n2)\r\n n1.to_i ** n2.to_i\r\nend", "def power(num1, num2)\n return num1**num2\nend", "def power(num1, num2)\n return num1**num2\nend", "def power(n1, n2)\n return n1**n2\nend", "def power(n1, n2)\n n1 ** n2\nend", "def power(nb1, nb2)\n return nb1 ** nb2\nend", "def power_it(number_1, number_2)\n number_1 ** number_2\nend", "def power(a,b)\n a.to_i ** b.to_i\nend", "def power(input1, input2)\n input1 ** input2\nend", "def exponentm(num_1,num_2)\n return num_1 ** num_2\nend", "def num_to_power(num, power)\n # count = 1\n return 1 if power == 0\n return num if power == 1\n num_multiply = power / 2\n product = 1\n num_multiply.times do\n product *= multiply(num, num)\n end\n if power % 2 == 1\n product *= num\n end\n product\nend", "def power(num, power)\n\tnum**power\nend", "def power(num, power)\r\n num ** power\r\nend", "def power(n1, n2)\n output = n1\n i = 0\n \n while i < n2\n i += 1\n output = output * n1\n \n end\n return output\nend", "def pow (base_num , pow_num)\n results=1\n pow_num.times do \n results*=base_num\n end \n results\nend", "def transmogrifier(num1,num2,square)\n\tresultOf = num1*num2\n\tnumberex = square * square\n\tresultpower = resultOf + numberex\nend", "def power(a, b)\n return a**b\nend", "def pow(a,b)\n power=1\n for i in 1..b\n power=power*a\n end\n return power\nend", "def #power(a,b)\n\ta ** b\nend", "def pow(base_num, pow_num)\n result = 1\n pow_num.times do\n result = result * base_num\n end\n return result\nend", "def pow(base_num, pow_num)\n result = 1\n pow_num.times do |index|\n result = result * base_num\n end\n\n return result\nend", "def power(base, power)\n base ** power\nend", "def power(base, power)\r\n base ** multiply(power, 1)\r\nend", "def power (num, exponent)\n if exponent == 0\n result = 1\n elsif exponent == 1\n result = num\n else\n result = multiply(num, num)\n (exponent-2).times { result = multiply(result, num) }\n result\n end\nend", "def exponent_1(base, power)\n\treturn 1 if power == 0\n\tlesser_power = power - 1\n\tbase_to_the_lesser_power = exponent_1(base, lesser_power)\n\tbase * base_to_the_lesser_power\nend", "def power(num, exponent)\n result = num\n (2..exponent).each { result = multiply(result, num) }\n result\nend", "def exponent_plus(num1, num2)\n total = (num1 ** 2) + num2\n return total\nend", "def power(integer, power)\n number_collection = []\n return nil if power < 0\n return 1 if power == 0\n \n power.times do\n number_collection << integer\n end\n \n number_collection.reduce(:*)\nend", "def power a, b\n\ttotal = a\n\twhile b > 1\n\t\ttotal = total * a\n\t\tb = b - 1\n\tend\n\ttotal\nend", "def exponentiate(number, power)\n power = power.to_int\n puts \"#{number} ** #{power} = #{number ** power}\\n\"\nend", "def power_to_the(power, num)\n result = multiply(num, num)\n if power >=3\n (power - 2).times { result = result * num }\n end\n result\nend", "def power_to_the_n(num, power)\n if power == 0\n 1\n elsif power == 1\n num\n else \n counter = 2\n total = multiply(num, num)\n while counter < power\n total = multiply(total, num)\n counter += 1\n end\n total \n end \nend", "def power(number)\n solved = 2 ** number\n numbers = solved.to_s.split(\"\")\n int_arr = numbers.map { |x| x.to_i }\n int_arr.inject(:+)\nend", "def raise_to_power(x, y)\n #every shift left is like a * 2\n #11000\nend", "def applyOperator(num1, num2, operator)\n\n\t\tif operator == \"+\"\n\t\t\treturn num1.to_i + num2.to_i\n\t\tend\n\n\t\tif operator == \"-\"\n\t\t\treturn num1.to_i - num2.to_i\n\t\tend\n\n\t\tif operator == \"*\"\n\t\t\treturn num1.to_i * num2.to_i\n\t\tend\n\n\t\tif operator == \"/\"\n\t\t\treturn num1.to_i / num2.to_i\n\t\tend\n\n\t\tif operator == \"%\"\n\t\t\treturn num1.to_i % num2.to_i\n\t\tend\n\n\t\tif operator == \"^\"\n\t\t\treturn num1.to_i ** num2.to_i\n\t\tend\n\n end", "def power(n)\n n ** 2\nend", "def powers_of_2\r\n\t\tunless $powers_of_2\r\n\t\t\t$powers_of_2 = [1]\r\n\t\t\t((BASE_BYTE << 3) - 1).times do |i|\r\n\t\t\t\t$powers_of_2[i + 1] = $powers_of_2[i] << 1\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\treturn $powers_of_2\r\n\tend", "def power_to_n(num, power)\n result = 1\n power.times { result = multiply(result, num) }\n result\nend", "def exp_two(num, power)\n return 1 if power == 0\n return num if power == 1\n if power.odd?\n exp = exp_two(num, (power - 1) / 2)\n num * exp * exp\n else\n exp = exp_two(num, power / 2)\n exp * exp\n end\nend", "def power(curr_value, to_power)\n curr_value**to_power\nend", "def power_of(num, exponent)\n product = multiply(num, num)\n \n (exponent - 2).times { product *= num }\n\n product\nend", "def power(a,b)\n @a=a\n @b=b\n\n return @a**@b\n\nend", "def exponent(input_number1)\n\texponent = input_number1 ** input_number2\n\tputs \"The exponent of #{input_number1} to the power of #{input_number2} is #{exponent}.\"\n\tputs \"Thank you for using the calculator. Goodbye!\"\nend", "def power(num,pow)\n if pow == 0\n num\n else\n total = 1\n count = 0\n while count < pow\n total *= num\n count += 1\n end\n return total\n end\nend", "def power(x,y)\n\treturn x**y\nend", "def pow(base, exponent)\n\n result = 1\n exponent.times do \n result = base.to_i * result\n end\n result\nend", "def multiply(n1, n2)\r\n n1.to_i * n2.to_i\r\nend", "def power(base, exponent)\n result = 1\n exponent.times { result *= base }\n result\nend", "def power (x,y)\n return x**y \nend", "def power(base, exponent)\n if !base.is_a?(Integer) || !exponent.is_a?(Integer)\n return nil\n else \n product = 1\n (1..exponent).each do\n product *= base\n end\n return product\n end\nend", "def exponent1(base, power)\n\treturn 1 if power == 0\n\tbase * exponent1(base, power - 1)\nend", "def power(base, exp)\n return base ** exp\nend", "def powers1(n)\n n.to_s(2).to_i.digits.map.with_index { |c, i| c.to_i * 2**i }.reject(&:zero?)\nend", "def power(base,exponent)\n\n return base ** exponent\nend", "def power(x,y)\n x**y\nend", "def nearest_two_power(num)\n return 1 if num == 0\n exp = Math.log(num, 2).ceil\n if exp == 0\n 1\n else\n 2**exp\n end\n end", "def pow_of_2(int)\n\tif int <= 0\n\t\treturn 1\n\tend\n\n\tint -= 1\n\treturn 2 * pow_of_2(int)\nend", "def pow(base, exponent) #(3, 4) ==> 3 * 3 * 3 * 3 = \n return 1 if exponent == 0 \n #return base if exponent == 1\n base * pow(base, exponent - 1)\nend", "def power_to_the_n(number, power)\n return 1 if power == 0\n result = 1\n while power > 0\n result = multiply(result, number)\n power -= 1\n end\n result\nend", "def pow(base_num, pow_num)\n result = 1\n pow_num.times do |index|#loop trough the code ex: if pow_num is = 3, the loop will trough 3 times.\n result = result * base_num\n end\n return result\nend", "def rec_exp_2(base, power)\nend", "def power (*base_and_power)\n base_and_power.inject(:**)\nend", "def multiply(num1, num2)\n return 0 if num1 == 0 || num2 == 0\n if num1 > 0\n num2 + multiply(num1-1, num2)\n else\n -num2 + multiply(num1+1, num2)\n end\nend", "def power(b, n)\n\n\t# b^n.to_i\n\n\tb ** n\n\nend", "def multiplier(num1, num2)\nnum1 * num2\nend", "def multiplier(num1, num2)\nnum1 * num2\nend", "def power(base, exponent)\n exponent <= 1 ? base : base * (power base, (exponent - 1))\nend", "def exponentiation(base, power)\n return 1 if power == 0\n base * exponentiation(base, power - 1)\nend", "def exponent1(base, power)\n # if power equals zero , then 1 else (base * method(base,power - 1))\n if power == 0\n return 1\n else\n (base * exponent1(base, power - 1))\n end\nend", "def multiplier(num1, num2)\n num1 * num2\nend", "def power_of_n(number, power)\n array = [number] * power\n base_number = 1\n array.each do |num|\n base_number = multiply(base_number, num)\n end\n base_number\nend", "def nearest_power_of_2(num)\n temp = num\n temp -= 1\n temp |= temp >> 1\n temp |= temp >> 2\n temp |= temp >> 4\n temp |= temp >> 8\n temp |= temp >> 16\n temp += 1\n temp\nend", "def power(base, exponent)\n total = 1\n\n exponent.times do\n total *= base\n end\n\n return total\nend", "def power_of_two?(num)\n product = 1\n\n while product < num \n product *= 2\n end \n\n product == num \nend", "def exp2(base, power)\n return 1 if power == 0\n half = exp2(base, power / 2)\n\n if power.even?\n half * half\n else\n # note that (power / 2) == ((power - 1) / 2) if power.odd?\n base * half * half\n end\nend", "def squared(num1)\n\tnum1 ** 2\nend", "def power_of_n(num, exponent)\n num ** exponent\nend", "def last_digit(n1, n2)\n return 1 if n2 == 0\n return 0 if n1 == 0\n\n exp = n2 % 4 == 0 ? 4 : n2 % 4\n (n1**exp) % 10\nend", "def exponent_v1(base, power)\n return 1 if power <= 0\n base * exponent_v1(base, power-1)\nend", "def power(base,exponent)\n i = 0\n output = 1\n while i < exponent\n output = output * base\n i += 1\n end\n return output\nend", "def __power(other) # [\n other = Maglev::Type.coerce_to( other, Fixnum, :to_int)\n kind = @special\n if kind._not_equal?(0) # not finite\n return self.class.__nan\n elsif self.zero?\n if other > 0\n return self.class.__zero(1)\n elsif other == 0\n return self.class.__from_integer( 1 )\n else\n return self.class.__infinity(1)\n end\n end\n if other == 0\n one = self.class.__from_integer( 1 )\n if self == one\n return one\n end\n end\n if other < 0\n pos_pwr = self.__power( 0 - other )\n one = self.class.__from_integer( 1 )\n q = one.div( pos_pwr )\n return q\n end\n nd = @digits ** other\n if (@sign == -1)\n nsign = (other & 1) == 0 ? 1 : -1 # even arg --> positive result\n else\n nsign = 1\n end\n nexp = @exp * other\n arr = __reduce_trailing_zeros(nd)\n nd = arr[0]\n nexp += arr[1]\n res = self.class.allocate\n res.__init_normal( nsign, nd, nexp)\n res.__set_precision(UNLIM_PRECISION)\n end", "def pow(base, exponent)\n\n result = 1\n\n exponent.times do\n result = result * base\n end\n\n return result\n \n end", "def exp2(base, power)\n return 1 if power == 0\n\n half = exp2(base, power / 2)\n\n if power.even?\n half * half\n else\n # note that (power / 2) == ((power - 1) / 2) if power.odd?\n base * half * half\n end\nend", "def multiply(num1, num2)\n result = 0\n if num1 > num2\n num2.times do\n result += num1\n end\n else\n num1.times do\n result += num2\n end\n end\n result\nend", "def power(base, exponent)\n return nil if exponent < 0\n\n return 1 if exponent == 0\n\n value = base\n\n (exponent - 1).times do value *= base end\n\n value\nend", "def exponent1(base, num)\n return 1 if num == 0\n return base if num == 1\n x = base * exponent1(base, num-1)\n\nend", "def multiply(num1, num2)\n\treturn num1*num2\nend", "def sum_base_2_number(pow = 1)\n (2**pow).to_s.split('').map(&:to_i).inject(:+)\nend", "def power_of_two?(num)\n product = 1\n while product < num\n product *= 2\n end\n\n num == product\nend", "def square(term1)\n return term1.to_i ** 2\nend", "def power2(key)\n self.class.power2(key)\n end", "def power_of_two?(num)\n\nend", "def multiply(num1, num2)\n num1 ** num2\nend", "def power(base,exponent)\n i=1\n output = base\n while i<exponent\n output = output*base\n i += 1\n end\n return output\nend", "def power_digits(n)\r\n sum = 2 ** n\r\n sum = sum.to_s.split(\"\").map{|x| x.to_i}.reduce(:+)\r\n return sum \r\nend", "def power_level(x, y)\n ((((x + 10) * y ) + $serial_num) * (x + 10)).digits[2] - 5\nend", "def power_level(x, y)\n ((((x + 10) * y ) + $serial_num) * (x + 10)).digits[2] - 5\nend", "def multiply(num1, num2)\n\treturn num1 * num2\nend", "def multiply(num1, num2)\n num1 * num2\n end", "def multiply(n1, n2)\n return n1*n2\n end" ]
[ "0.80441004", "0.7976614", "0.79447675", "0.79447675", "0.7922328", "0.78334236", "0.77964866", "0.7736557", "0.7570357", "0.7410962", "0.7199833", "0.71449816", "0.7132441", "0.71121764", "0.71075374", "0.7052429", "0.7035631", "0.6969633", "0.6965739", "0.6957376", "0.6922882", "0.6918338", "0.69182223", "0.68915534", "0.68038297", "0.67888826", "0.67876923", "0.6758186", "0.6755692", "0.674649", "0.67357796", "0.67357576", "0.6734762", "0.6728495", "0.6720631", "0.6715625", "0.6703327", "0.669858", "0.66979307", "0.66773486", "0.66744596", "0.6667212", "0.66671", "0.6639216", "0.6638903", "0.66328245", "0.66302055", "0.662878", "0.6624462", "0.661671", "0.66069686", "0.66034967", "0.66023", "0.6592035", "0.65891045", "0.6566877", "0.65537983", "0.65531176", "0.6548246", "0.6542672", "0.65342593", "0.6502092", "0.64867014", "0.6482203", "0.64793396", "0.64517605", "0.64517605", "0.6441429", "0.64338934", "0.6431925", "0.6427232", "0.64228076", "0.6416953", "0.64168406", "0.64164937", "0.64143103", "0.6407505", "0.6406645", "0.6406527", "0.6383246", "0.63811827", "0.63749325", "0.6370869", "0.63706857", "0.6370389", "0.6369272", "0.6364455", "0.6354007", "0.6344936", "0.63390946", "0.63332355", "0.6325735", "0.63248235", "0.63248014", "0.63216317", "0.6316525", "0.6304756", "0.6304756", "0.62969416", "0.6287217", "0.6282442" ]
0.0
-1
GET /plans GET /plans.json
def index @search = params[:search].to_s @status = params[:status].to_s @artist = params[:artist].to_s @purchase_date_start = params[:purchase_date_start].to_s @purchase_date_end = params[:purchase_date_end].to_s @music_orders = Order.joins('INNER JOIN users AS u ON u.id=orders.user_id').joins('INNER JOIN order_items AS oi ON oi.order_id=orders.id').joins('INNER JOIN audios ON audios.id=oi.product_id') if @search.length > 0 searchText = '%'+@search+'%' @music_orders = @music_orders.where("CONCAT(u.first_name,' ',u.last_name) LIKE ?",searchText) end if @artist!="" @music_orders = @music_orders.where("audios.user_id=?",@artist) #@music_orders = Order.joins('INNER JOIN audios ON audios.id=oi.product_id') end if @status == "Complete" @music_orders = @music_orders.where("order_status=1") elsif @status == "Incomplete" @music_orders = @music_orders.where("order_status=0") end if @purchase_date_start!="" @music_orders = @music_orders.where("date(created_at)>=?",@purchase_date_start) end if @purchase_date_end!="" @music_orders = @music_orders.where("date(created_at)<=?",@purchase_date_end) end @music_orders = @music_orders.order('created_at DESC').paginate(:page => params[:page], :per_page => 10) #render text: @music_orders.to_sql end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans(params = {})\n scope 'default'\n get('plans/', params)\n end", "def index\n @plans = Plan.all\n\n render json: @plans\n end", "def index\n @plans = Plan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end", "def index\n respond_with(@plans = Plan.all)\n end", "def show\n @plan = Plan.find(params[:id])\n\n render json: @plan\n end", "def show\n @plans = Stripe::Plan.all\n end", "def index\n @plans = Plan.all\n end", "def index\n @plans = Plan.all\n end", "def show\n @plans = @event.plans\n \n respond_to do |format|\n format.html {}\n format.json { render json: @event.to_json}\n end\n end", "def show\n render json: @plan\n end", "def all_plans\n file = File.read('./data/bundle.json')\n plan_hash = JSON.parse(file)\n plans = plan_hash['plans']\n end", "def fetch_plans (id = nil)\n @plans = []\n parameters = {}\n @networks_by_plan = {}\n parameters[:_profile] = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-InsurancePlan' \n if(id)\n parameters[:_id] = id\n end\n\n @client.search(\n FHIR::InsurancePlan,\n search: { parameters: parameters }\n )&.resource&.entry&.map do |entry|\n @plans << {\n value: entry&.resource&.id,\n name: entry&.resource&.name\n }\n @networks_by_plan [ entry&.resource&.id] = entry&.resource&.network\n end\n @plans.sort_by! { |hsh| hsh[:name] }\n rescue => exception\n redirect_to root_path, flash: { error: 'Please specify a plan network server' }\n\n end", "def index\n @site_plans = @product.site_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @site_plans }\n end\n end", "def read_service_plans()\n @client.service_plans\n end", "def plans\r\n @plans ||= PlansController.new(configuration: @configuration)\r\n end", "def plans\n return @plans\n end", "def index\n @plans = Plan.where(user_id: current_user.id)\n end", "def list_plans(filter: nil)\n {\n plans: filter_content(pal.list_plans_with_cache(filter_content: true), filter),\n modulepath: pal.user_modulepath\n }\n end", "def pharmacy_plans(params = {})\n response = default_scope.get('pharmacy/plans') do |request|\n request.params = params\n end\n JSON.parse(response.body)\n end", "def index\n @floor_plans = @product.floor_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @floor_plans }\n end\n end", "def url\n resource.url + '/application_plans'\n end", "def plan\n data['plans'][me]\n end", "def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end", "def index\n if user_signed_in?\n @plans = Plan.where(user_id: current_user.id)\n else\n @plans = []\n end\n end", "def plans=(value)\n @plans = value\n end", "def index\n @test_plans = @project.test_plans\n end", "def index\n @care_plans = CarePlan.all\n render json: @care_plans\n end", "def index\n @page_plans = PagePlan.all\n end", "def index\n @lesson_plans = current_user.lesson_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lesson_plans }\n end\n end", "def index\n\n @goals = Goal.by_person_as_student(current_user.person)\n @goals = @goals.by_plan(params[:plan_id]) if params[:plan_id].present?\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goals }\n end\n end", "def show\n @test_plan = TestPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_plan }\n end\n end", "def plans\n @plans ||= spinner('Loading plans') { Loader.load_all configuration.plan_files }\n end", "def show\n @planitem = Planitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @planitem }\n end\n end", "def index\n @billing_plans = BillingPlan.all\n end", "def index\n @plans = Plan.order('created_at desc')\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @plans }\n end\n end", "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "def status\n @plan = Plan.find(params[:id])\n authorize @plan\n respond_to do |format|\n format.json { render json: @plan.status }\n end\n end", "def show\n @sslplan = Sslplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @sslplan }\n end\n end", "def show(project_token = @project_token, id = @id, user = @@default_user)\n @attributes = send_request(\"test_plans/#{id}\", :get) do |req|\n req.params = {\n token: project_token,\n auth_token: user.auth_token\n }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n end", "def index\n @callplans = Callplan.all\n end", "def show\n @panel_plan = Panel::Plan.find(params[:id])\n @features = Panel::Planfeature.where(:panel_plan_id => params[:id]).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @panel_plan }\n end\n end", "def plans\n\t @plans = Plan.all\n\t current_user.clean_subscriptions if current_user\n\tend", "def index\n if current_user.is_admin?\n @plans = Plan.all\n else\n @plans = Plan.where(user_id: current_user.id)\n end\n end", "def index\n @art_plans = current_user.art_plans\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @site_plan }\n end\n end", "def show\n @plantype = Plantype.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plantype }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n @plan_days = @plan.plan_days\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan }\n end\n end", "def index\n @payment_plans = PaymentPlan.all\n end", "def index_crud\n\n @plans = Plan.all\n render :index_crud\n end", "def show\n set_client_profile(@plan)\n @goals = @plan.goals\n @tasks = @plan.tasks\n end", "def all_plans\n if current_user.typeofuser == \"admin\" then\n @tenant = current_user.tenant\n @current_plan = @tenant.pricing_plan\n @selected_plan = PricingPlan.find(@tenant.selected_plan_id)\n @pricing_plans = PricingPlan.where(:plan_type => 'public')\n end\n end", "def plans\n subscriptions.map(&:plan)\n end", "def index\n @media_plans = MediaPlan.all\n end", "def index\n @calls = Call.all\n @plans = Plan.all\n end", "def get_test_plan\n @takt = Taktinfo.find(params[:id])\n @testplans = @takt.testplans.where(:format =>params[:testp])\n\n respond_to do |format|\n format.json{render json:@testplans.as_json(root:false),:callback =>params[:callback]}\n end\n end", "def retrieve_plan_list\n options = { limit: 100 }\n options[:offset] = @offset if @offset.present?\n ChargeBee::Plan.list(options)\n end", "def show\n @work_plan = WorkPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_plan }\n end\n end", "def index\n authorize Plan\n @plans = Plan.includes(:roles).active(current_user).page(1)\n @organisationally_or_publicly_visible = if current_user.org.is_other?\n []\n else\n Plan.organisationally_or_publicly_visible(current_user).page(1)\n end\n # TODO: Is this still used? We cannot switch this to use the :plan_params\n # strong params because any calls that do not include `plan` in the\n # query string will fail\n @template = Template.find(params[:plan][:template_id]) if params[:plan].present?\n end", "def index\n @tipo_plans = TipoPlan.all\n end", "def plan(accountname)\n response = get_request(\"/users/#{accountname}/plan\")\n end", "def plan(accountname)\n response = get_request(\"/users/#{accountname}/plan\")\n end", "def show\n @plantype_strategy = PlantypeStrategy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plantype_strategy }\n end\n end", "def show\n\n # Get base API Connection\n @graph = Koala::Facebook::API.new(session[:access_token])\n\n # Get public details of current application\n #@app = @graph.get_object(ENV[\"FACEBOOK_APP_ID\"])\n\n\n @user = User.find(params[:id])\n @plans = @user.plans.all\n\n @upcoming_plans = @user.plans.find(:all, :conditions => [\"plandate >= ?\", Date.today]).sort_by { |obj| obj.plandate }\n #@past_plans = @user.plans.find(:all, :conditions => [\"plandate < ?\", Date.today]).sort_by { |obj| obj.plandate }\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "def show\n @plan_setting = PlanSetting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan_setting }\n end\n end", "def show\r\n @work_plan = WorkPlan.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @work_plan }\r\n end\r\n end", "def index\n respond_with(end_user_plans)\n end", "def show\n @id = params[:id]\n if @id\n @plans = Plan.where(:servicio_id => @id)\n else\n @plans = Plan.all\n end\n\n end", "def plans_available_bam(country)\n plan = Plan.select('id, name, detail, price').where('country= ? AND item= ?',\n country, 'bam')\n # Format to show in view\n plans = plan.map { |m| [m.name, m.id] }\n # Format to display details of plans\n details = plan.map {|m| [m.id, m.detail]}\n return [plans, details]\n end", "def account_plans_with_http_info(account_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BillingApi.account_plans ...'\n end\n # verify the required parameter 'account_id' is set\n if @api_client.config.client_side_validation && account_id.nil?\n fail ArgumentError, \"Missing the required parameter 'account_id' when calling BillingApi.account_plans\"\n end\n # resource path\n local_var_path = '/accounts/{accountId}/plans'.sub('{' + 'accountId' + '}', account_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20015')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BillingApi#account_plans\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @meal_plans = MealPlan.all\n end", "def show\n @klassplan = Klassplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @klassplan }\n end\n end", "def index\n @business_plans = BusinessPlan.all\n end", "def new\n @panel_plan = Panel::Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @panel_plan }\n end\n end", "def index\n @inventory_plans = InventoryPlan.all\n end", "def index\n @plan_milestones = PlanMilestone.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_milestones }\n end\n end", "def index\n @operative_plans = OperativePlan.all\n end", "def get_plansbyid\n if session[:plansbyid]\n @plansbyid = JSON.parse(decompress_hash(session[:plansbyid])).deep_symbolize_keys\n @locationsbyid = JSON.parse(decompress_hash(session[:locationsbyid])).deep_symbolize_keys\n @cp_options = decompress_hash(session[:cp_options])\n @search = session[:query]\n else\n puts \"get_plansbyid: session[:plansbyid] is #{session[:plansbyid]}, calling coverage_plans \"\n coverage_plans\n end\n end", "def find_test_plans()\n begin\n uri1 = \"get_plans/#{@tr_project['id']}\"\n plan_shells = testrail_send('get', uri1)\n plans = []\n plan_shells.each do |plan_shell|\n uri2 = \"get_plan/#{plan_shell['id']}\"\n plan = testrail_send('get', uri2)\n runs = []\n tests = []\n run_ids = []\n \n entries = plan['entries'] || []\n entries.each do |entry|\n run_shells = entry['runs']\n run_shells.each do |run_shell|\n uri3 = \"get_run/#{run_shell['id']}\"\n run = testrail_send('get', uri3)\n runs.push(run)\n \n uri4 = \"get_tests/#{run_shell['id']}\"\n test = testrail_send('get', uri4)\n tests.push(test)\n \n run_ids.push(run_shell['id'])\n end\n end\n plan['runs'] = runs\n plan['tests'] = tests\n plan['run_ids'] = run_ids\n plans.push(plan)\n end\n rescue Exception => ex\n raise UnrecoverableException.new(\"Failed to find any Test Plans.\\n TestRail api returned:#{ex.message}\", self)\n end\n\n return plans\n end", "def api_v1_online_job_plans_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OnlineJobPlanApi.api_v1_online_job_plans_get ...'\n end\n # resource path\n local_var_path = '/api/v1/online_job_plans'\n\n # query parameters\n query_params = {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?\n query_params[:'filter[id]'] = opts[:'filter_id'] if !opts[:'filter_id'].nil?\n query_params[:'filter[owner_id]'] = opts[:'filter_owner_id'] if !opts[:'filter_owner_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['apiEmail', 'apiToken']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'OnlineJobPlansResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OnlineJobPlanApi#api_v1_online_job_plans_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @local_plans = LocalPlan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @local_plans }\n end\n end", "def show\n id = @call.plan_id\n @plan = Plan.find(id)\n @plan = @plan.name\n end", "def floorplans\r\n FloorplansController.instance\r\n end", "def show\n set_client_profile(@goal)\n @plans = @goal.plans\n @tasks = @plans.map(&:tasks).flatten.uniq\n\n\n @needs = @goal.needs\n end", "def index\n @admin_subscription_plans = Admin::SubscriptionPlan.all\n end", "def status\n \t\t@plan = Plan.find(params[:id])\n authorize @plan\n \t\tif user_signed_in? && @plan.readable_by(current_user.id) then\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json { render json: @plan.status }\n\t\t\tend\n\t\telse\n\t\t\trender(:file => File.join(Rails.root, 'public/403.html'), :status => 403, :layout => false)\n\t\tend\n\tend", "def index\n @pricing_plans = PricingPlan.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pricing_plans }\n end\n end", "def show\n @lesson_plan = current_user.lesson_plans.detect{params[:id]}\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lesson_plan }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n @invites = @plan.invites.all\n @microposts = @plan.microposts.all\n @suggestions = @plan.suggestions.all.sort_by { |obj| - obj.pointcount }\n\n @venues = Venue.all.sort_by{ |obj| obj['name'] }\n\n @graph = Koala::Facebook::API.new(session[:access_token])\n # Get public details of current application\n #@app = @graph.get_object(ENV[\"FACEBOOK_APP_ID\"])\n\n @friends = @graph.get_connections('me', 'friends').sort_by { |obj| obj['name'] }\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plan }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plan }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plan }\n end\n end", "def api_v1_online_job_plans_get(opts = {})\n data, _status_code, _headers = api_v1_online_job_plans_get_with_http_info(opts)\n data\n end", "def index\n @plan = Plan.new\n @incident = Incident.find(params[:incident_id])\n @plans = Plan.where(incident_id: @incident.id).order(date: :desc)\n end", "def index\n @meeting_plans = MeetingPlan.all\n end", "def index\n @mealplans = Mealplan.all\n end", "def show\n render json: @care_plan\n end", "def index\n @article_plans = ArticlePlan.all\n end", "def create\n @plan = Plan.new(params[:plan])\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "def show\n @lunchplan = Lunchplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lunchplan }\n end\n end" ]
[ "0.83793116", "0.8245937", "0.79580194", "0.771876", "0.76548684", "0.75855523", "0.75678337", "0.75678337", "0.7560124", "0.7451438", "0.7422722", "0.7376277", "0.7278245", "0.7252006", "0.71429604", "0.71125525", "0.7108914", "0.7099293", "0.70921487", "0.70670223", "0.70186085", "0.70038766", "0.6986182", "0.6967528", "0.69564795", "0.694123", "0.6910125", "0.68599254", "0.6831191", "0.6824504", "0.68121725", "0.6809849", "0.6793611", "0.67850417", "0.67782444", "0.67535126", "0.67535126", "0.674912", "0.6749114", "0.67312294", "0.67285395", "0.6726977", "0.6711452", "0.67053676", "0.66598386", "0.66592777", "0.6651096", "0.6646852", "0.6627603", "0.66275376", "0.662264", "0.66176", "0.6608625", "0.6504819", "0.64994544", "0.64777637", "0.64699554", "0.6468911", "0.6468743", "0.64573896", "0.64550555", "0.6452433", "0.6452433", "0.643947", "0.6433847", "0.64328104", "0.64230883", "0.6421842", "0.64164037", "0.6413557", "0.6409676", "0.63948286", "0.6391467", "0.6387768", "0.6379997", "0.63598263", "0.63258344", "0.631796", "0.6315103", "0.6311701", "0.6309425", "0.63073736", "0.6302495", "0.62953913", "0.62861985", "0.62851584", "0.62806624", "0.62806565", "0.62787616", "0.6276424", "0.627436", "0.627436", "0.627436", "0.62676233", "0.6265189", "0.6254976", "0.62492657", "0.62454003", "0.6236338", "0.6234695", "0.6217959" ]
0.0
-1
GET /plans/1 GET /plans/1.json
def show #render text: @music_order.order_items.length and return end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans(params = {})\n scope 'default'\n get('plans/', params)\n end", "def index\n @plans = Plan.all\n\n render json: @plans\n end", "def show\n @plan = Plan.find(params[:id])\n\n render json: @plan\n end", "def index\n @plans = Plan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end", "def show\n @plans = @event.plans\n \n respond_to do |format|\n format.html {}\n format.json { render json: @event.to_json}\n end\n end", "def show\n render json: @plan\n end", "def index\n respond_with(@plans = Plan.all)\n end", "def index\n @plans = Plan.all\n end", "def index\n @plans = Plan.all\n end", "def show\n @plans = Stripe::Plan.all\n end", "def index\n @site_plans = @product.site_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @site_plans }\n end\n end", "def fetch_plans (id = nil)\n @plans = []\n parameters = {}\n @networks_by_plan = {}\n parameters[:_profile] = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-InsurancePlan' \n if(id)\n parameters[:_id] = id\n end\n\n @client.search(\n FHIR::InsurancePlan,\n search: { parameters: parameters }\n )&.resource&.entry&.map do |entry|\n @plans << {\n value: entry&.resource&.id,\n name: entry&.resource&.name\n }\n @networks_by_plan [ entry&.resource&.id] = entry&.resource&.network\n end\n @plans.sort_by! { |hsh| hsh[:name] }\n rescue => exception\n redirect_to root_path, flash: { error: 'Please specify a plan network server' }\n\n end", "def show\n @planitem = Planitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @planitem }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n end", "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "def all_plans\n file = File.read('./data/bundle.json')\n plan_hash = JSON.parse(file)\n plans = plan_hash['plans']\n end", "def show\n @test_plan = TestPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_plan }\n end\n end", "def plan\n data['plans'][me]\n end", "def show\n @sslplan = Sslplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @sslplan }\n end\n end", "def show\n @plantype = Plantype.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plantype }\n end\n end", "def url\n resource.url + '/application_plans'\n end", "def index\n @floor_plans = @product.floor_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @floor_plans }\n end\n end", "def index\n\n @goals = Goal.by_person_as_student(current_user.person)\n @goals = @goals.by_plan(params[:plan_id]) if params[:plan_id].present?\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goals }\n end\n end", "def index\n @plans = Plan.where(user_id: current_user.id)\n end", "def show(project_token = @project_token, id = @id, user = @@default_user)\n @attributes = send_request(\"test_plans/#{id}\", :get) do |req|\n req.params = {\n token: project_token,\n auth_token: user.auth_token\n }\n end\n end", "def status\n @plan = Plan.find(params[:id])\n authorize @plan\n respond_to do |format|\n format.json { render json: @plan.status }\n end\n end", "def index\n plan = Plan.find_by(url:params[:plan_id])\n stories = plan.stories\n render json: stories\n end", "def index\n @test_plans = @project.test_plans\n end", "def read_service_plans()\n @client.service_plans\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @site_plan }\n end\n end", "def show\n @plan_setting = PlanSetting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan_setting }\n end\n end", "def plans\r\n @plans ||= PlansController.new(configuration: @configuration)\r\n end", "def show\n @panel_plan = Panel::Plan.find(params[:id])\n @features = Panel::Planfeature.where(:panel_plan_id => params[:id]).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @panel_plan }\n end\n end", "def show\n @work_plan = WorkPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_plan }\n end\n end", "def index\n @care_plans = CarePlan.all\n render json: @care_plans\n end", "def show\n @id = params[:id]\n if @id\n @plans = Plan.where(:servicio_id => @id)\n else\n @plans = Plan.all\n end\n\n end", "def index\n @plans = Plan.order('created_at desc')\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @plans }\n end\n end", "def show\r\n @work_plan = WorkPlan.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @work_plan }\r\n end\r\n end", "def show\n @plan = Plan.find(params[:id])\n @plan_days = @plan.plan_days\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan }\n end\n end", "def show\n @klassplan = Klassplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @klassplan }\n end\n end", "def show\n id = @call.plan_id\n @plan = Plan.find(id)\n @plan = @plan.name\n end", "def index_crud\n\n @plans = Plan.all\n render :index_crud\n end", "def index\n @page_plans = PagePlan.all\n end", "def show\n set_client_profile(@plan)\n @goals = @plan.goals\n @tasks = @plan.tasks\n end", "def new\n @panel_plan = Panel::Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @panel_plan }\n end\n end", "def index\n @billing_plans = BillingPlan.all\n end", "def show\n @plantype_strategy = PlantypeStrategy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plantype_strategy }\n end\n end", "def pharmacy_plans(params = {})\n response = default_scope.get('pharmacy/plans') do |request|\n request.params = params\n end\n JSON.parse(response.body)\n end", "def index\n @callplans = Callplan.all\n end", "def show\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plan }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plan }\n end\n end", "def show\n @plan = Plan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plan }\n end\n end", "def show\n @project_procurement_management_plan = ProjectProcurementManagementPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project_procurement_management_plan }\n end\n end", "def index\n if user_signed_in?\n @plans = Plan.where(user_id: current_user.id)\n else\n @plans = []\n end\n end", "def index\n @lesson_plans = current_user.lesson_plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lesson_plans }\n end\n end", "def plans=(value)\n @plans = value\n end", "def show\n @lunchplan = Lunchplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lunchplan }\n end\n end", "def index\n @payment_plans = PaymentPlan.all\n end", "def show\n @id = @plan.id\n @name = @plan.name\n @major = @plan.major\n end", "def show\n @planner = Planner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @planner }\n end\n end", "def retrievePlan(_planId)\n result = ChargeBee::Plan.retrieve(_planId)\n return result.plan\n end", "def retrievePlan(_planId)\n result = ChargeBee::Plan.retrieve(_planId)\n return result.plan\n end", "def plans\n return @plans\n end", "def show\n @workout_plan = @single_plan.workout_plans.first\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @single_plan }\n end\n end", "def new\n @sslplan = Sslplan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sslplan }\n end\n end", "def show\n @plannegocio = Plannegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plannegocio }\n end\n end", "def show\n @exercise_plan = ExercisePlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise_plan }\n end\n end", "def show\n @lesson_plan = current_user.lesson_plans.detect{params[:id]}\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lesson_plan }\n end\n end", "def get_test_plan\n @takt = Taktinfo.find(params[:id])\n @testplans = @takt.testplans.where(:format =>params[:testp])\n\n respond_to do |format|\n format.json{render json:@testplans.as_json(root:false),:callback =>params[:callback]}\n end\n end", "def show\n @plan_milestone = PlanMilestone.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan_milestone }\n end\n end", "def find_plan\n if params[:plan_ids].present?\n @plan = @provider.service_plans.published.find(params[:plan_ids].first)\n end\n end", "def new\n @plan_setting = PlanSetting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan_setting }\n end\n end", "def list_plans(filter: nil)\n {\n plans: filter_content(pal.list_plans_with_cache(filter_content: true), filter),\n modulepath: pal.user_modulepath\n }\n end", "def index\n @tipo_plans = TipoPlan.all\n end", "def index\n if current_user.is_admin?\n @plans = Plan.all\n else\n @plans = Plan.where(user_id: current_user.id)\n end\n end", "def show\n @backend_planet = Backend::Planet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @backend_planet }\n end\n end", "def create\n @plan = Plan.new(params[:plan])\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "def floorplans\r\n FloorplansController.instance\r\n end", "def new\n @test_plan = TestPlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_plan }\n end\n end", "def show\n @socialize_plan = SocializePlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @socialize_plan }\n format.json { render :json => @socialize_plan }\n end\n end", "def index\n @calls = Call.all\n @plans = Plan.all\n end", "def index\n @plan = Plan.new\n @incident = Incident.find(params[:incident_id])\n @plans = Plan.where(incident_id: @incident.id).order(date: :desc)\n end", "def new\n @plantype = Plantype.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plantype }\n end\n end", "def index\n @media_plans = MediaPlan.all\n end", "def index\n authorize Plan\n @plans = Plan.includes(:roles).active(current_user).page(1)\n @organisationally_or_publicly_visible = if current_user.org.is_other?\n []\n else\n Plan.organisationally_or_publicly_visible(current_user).page(1)\n end\n # TODO: Is this still used? We cannot switch this to use the :plan_params\n # strong params because any calls that do not include `plan` in the\n # query string will fail\n @template = Template.find(params[:plan][:template_id]) if params[:plan].present?\n end", "def show\n render json: @care_plan\n end", "def index\n @plan_milestones = PlanMilestone.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plan_milestones }\n end\n end", "def set_plan\n return unless json_request?\n @plan = current_user.plans.find_by_ident(params[:id])\n return render json: { status: 'failed', alert: '此计划不存在' } unless @plan\n end", "def show\n set_client_profile(@goal)\n @plans = @goal.plans\n @tasks = @plans.map(&:tasks).flatten.uniq\n\n\n @needs = @goal.needs\n end", "def create\n @plan = Plan.new(plan_params)\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "def plan(accountname)\n response = get_request(\"/users/#{accountname}/plan\")\n end", "def plan(accountname)\n response = get_request(\"/users/#{accountname}/plan\")\n end", "def show\n #@detail = Detail.find(params[:id])\n @plan = Plan.find(params[:plan_id])\n @detail = @plan.details.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detail }\n end\n end", "def new\r\n @general_plan = GeneralPlan.new\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @general_plan }\r\n end\r\n end", "def index\n @inventory_plans = InventoryPlan.all\n end", "def index\n @meal_plans = MealPlan.all\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @floor_plan }\n end\n end", "def get_plansbyid\n if session[:plansbyid]\n @plansbyid = JSON.parse(decompress_hash(session[:plansbyid])).deep_symbolize_keys\n @locationsbyid = JSON.parse(decompress_hash(session[:locationsbyid])).deep_symbolize_keys\n @cp_options = decompress_hash(session[:cp_options])\n @search = session[:query]\n else\n puts \"get_plansbyid: session[:plansbyid] is #{session[:plansbyid]}, calling coverage_plans \"\n coverage_plans\n end\n end", "def index\n @operative_plans = OperativePlan.all\n end", "def index\n @local_plans = LocalPlan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @local_plans }\n end\n end" ]
[ "0.80668986", "0.80299073", "0.7866424", "0.7828984", "0.75015014", "0.75013804", "0.747925", "0.7453174", "0.7453174", "0.7383227", "0.7175319", "0.715803", "0.7094077", "0.708701", "0.7042046", "0.7042046", "0.70326114", "0.701462", "0.70041215", "0.6973513", "0.69346154", "0.69321084", "0.691935", "0.68979466", "0.6877953", "0.6874199", "0.68321055", "0.682522", "0.6818409", "0.68076956", "0.67994237", "0.67919785", "0.67841023", "0.6755746", "0.67377776", "0.6725547", "0.67249066", "0.6703609", "0.66978747", "0.6676116", "0.66640675", "0.665807", "0.66578716", "0.6655156", "0.66446376", "0.6643058", "0.6630782", "0.66133434", "0.6609679", "0.6582345", "0.6577065", "0.6577065", "0.6577065", "0.6574709", "0.65615237", "0.6559246", "0.6535835", "0.65232044", "0.6509835", "0.65062416", "0.65012574", "0.64883375", "0.64883375", "0.648734", "0.64652574", "0.64585686", "0.6445684", "0.6441603", "0.6440391", "0.64306635", "0.6429921", "0.64111656", "0.6410999", "0.637641", "0.6360542", "0.6357967", "0.63575935", "0.63528764", "0.63490605", "0.6344053", "0.63407016", "0.6331406", "0.6327031", "0.63264835", "0.6324274", "0.6322388", "0.63182336", "0.6317571", "0.62925255", "0.6291607", "0.6291136", "0.6288957", "0.6288957", "0.62849456", "0.62758535", "0.62686116", "0.6258691", "0.6239971", "0.62396616", "0.62383187", "0.623517" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_music_order @music_order = Order.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
End Validations TODO Is this OperatingTime applicable at +time+
def valid_at(time=Time.now) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_time_check\n if self.event_type == \"Script\" || self.event_type == \"Gamecall\"\n if end_time > start_time\n self.end_time = start_time\n end\n end\n end", "def validate\n\t\tif not isEmpty(self.time)\n\t\t\terrors.add(:time, \"is already occupied.\")\n\t\tend\n\t\tif not Schedule.isValidTimeSlot(self.schedule, self.time)\n\t\t\terrors.add(:time, \"is not a valid timeslot.\")\n\t\tend\n\tend", "def ends_after_it_starts\n if !starts_before_it_ends?\n errors.add(:start_time, 'must be before the end time')\n end\n end", "def validate_end_time\n if self.end_time.present? && self.end_time < self.start_time\n errors.add(:end_time, \"can't be before start time\")\n end\n end", "def valid?(time=Time.now.utc)\n time>not_before && time<self.not_after\n end", "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end", "def is_correct_time? #:doc:\n if(self.endTime && self.startTime && (self.endTime<=>self.startTime)==-1)\n errors.add([:starTime,:endTime],\"Attenzione l'ora di inizio è piu grande dell'ora di fine\")\n end\n end", "def valid_timing\n errors.add(:review, \"Invalid timing for review\") unless !reservation.nil? && reservation.status == \"accepted\" && reservation.checkout < Time.current\n end", "def valid_time\n return if init.nil? || finish.nil?\n if init < Week.init || init > Week.finish\n errors.add(:init, \"Deve ser no périodo desta semana\")\n elsif finish < Week.init || finish > Week.finish\n errors.add(:finish, \"Deve ser no périodo desta semana\")\n elsif finish < init\n errors.add(:finish, \"Deve ser maior que a data de início\")\n end\n end", "def validate_temporal_sanity\n errors.add(:end_time, \"Must be after Start Time.\") unless self.start_time < self.end_time\n end", "def end_time_is_valid\n errors.add(:end_time,'Invalid empty string for end time.') unless end_time_is_valid?\n end", "def end_time_after_start_time\n if self.end_time && self.end_time < self.start_time\n self.errors.add(:end_time, \"The end time must be after the start time\")\n end\n end", "def check_end_time\n return unless self.end_time?\n calculate_total_time unless self.total_time?\n end", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def date_consistency\n\t\treturn if [start_time.blank?, end_time.blank?].any?\n\t\terrors.add(:start_time, 'must be after end_time') if start_time > end_time\n\tend", "def validate\n\t \n\t if time\n\t \n\t today = Date.today\n\t date = Date.parse(time.to_s)\n\t if today > date\n\t errors.add(:time, \"deve ser maior que #{Converters::date_to_string(today)}.\")\n return\n\t end\n\t \n\t end\n\t \n\tend", "def end_time_after_start_time\n if start_time && end_time && end_time < start_time\n errors.add :end_time, \"must be after the start of shift\"\n errors.add :start_time, \"must be before the end of shift\"\n end\n end", "def time_must_be_in_the_future\n if !time.present? || DateTime.current > time\n errors.add(:time, \"cant be in the past\")\n end\n end", "def end_time_must_be_after_start_time\n if self.start_time > self.end_time\n errors.add(:end_time, 'must be after start time')\n end\n end", "def valid_after; end", "def end_time_after_start_time\n return if end_time.blank? || start_time.blank?\n\n if end_time < start_time\n errors.add(:end_time, \"must be after the start time\")\n end\n end", "def ends_after_start\n unless end_time.nil? || start_time.nil?\n errors[:end_time] << \"can't be before start time\" if end_time < start_time\n end\n end", "def delivery_time_can_not_be_too_soon\n if time < Time.now + @@starttime\n errors.add(\"Ora di consegna:\", \"ci vogliono almeno #{@@starttime/60} minuti per l\\'elaborazione.\n Quindi ordinazioni prima delle #{(Time.now + @@starttime).strftime(\"%H:%M\")} non possono essere accettate.\")\n end\n end", "def end_time_after_start_time\n if self.event_start_time && self.event_end_time\n errors.add(:event_end_time, \"must be after the event start time\") unless\n self.event_end_time >= self.event_start_time\n end\n end", "def end_time_is_valid?\n return false unless not_nil_and_string(self.end_time)\n return self.end_time.length > 0\n end", "def shift_end_hour\n if self.start_time.hour >= 0 && self.start_time.hour <= 2 && self.end_time.hour > 2 \n errors.add(:end_time, 'must be between 7am and 3am')\n end\n if self.end_time.hour > 2 && self.end_time.hour < 7\n errors.add(:end_time, 'must be between 7am and 3am')\n end \n end", "def check_time\t\n\t\treturn unless errors.blank? #this will ensure the right error count on top area\n\t\tif @start_date.present? && @start_time.present?\n\t\t\t#concatenate start_date and start_time\n\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") \n\t\t\t#variable that holds the time 12 hours from now\n\t\t\tstart_at_plus_12_hours = Time.now + (12.hours)\n\t\t\tif start_at <= Time.now\n\t\t\t\terrors.add(:start_date, \"Please do not enter a past date or past time.\")\n\t\t\t\terrors.add(:start_time, \"Please do not enter a past date or past time.\")\n\t\t\telsif start_at < start_at_plus_12_hours \n\t\t\t\terrors.add(:start_date, \"Please only enter a time 12 hours from now\")\n\t\t\tend\n\t\tend\n\tend", "def end_time_cannot_be_earlier_than_start_time\n\t\tif end_time && start_time \n\t\t\tif end_time < start_time\n\t\t\t\terrors.add(:end_time, \"End time should not be earlier than start time.\")\n\t\t\tend\n\t\tend\n\tend", "def time_cannot_be_in_the_past\n time1 = DateTime.now - 300.minutes\n time2 = self.time \n if time1 > time2 \n errors.add(:time, \"can't be in the past \")\n end\n end", "def meets_temporal_constraints?(time, &block)\n !find_failed_temporal_constraint(time, &block) &&\n !find_failed_occurence_constraint(true, &block)\n end", "def validate_time_lock\n unless time_lock.nil? or time_lock.valid?\n time_lock.errors.each_full do |err| \n self.errors.add :time_lock, err.gsub(/\\{lockable\\}/, self.to_str.humanize)\n end\n end\n end", "def set_valid_until_time\n if valid_until\n self.valid_until = valid_until.utc + (23-valid_until.hour).hours + (59-valid_until.min).minutes + (59-valid_until.sec).seconds unless category && category.name.eql?(\"rideshare\")\n end \n end", "def validate_timings\n p start_time, end_time\n if (start_time > end_time)\n errors[:base] << \"Start Time must be less than End Time\"\n end\n end", "def validate_with_shift_times # see alias_method_chain above\n #s_time = (start_time.hour * 2) + (start_time.min/30)\n #e_time = (params[:issue][:end_time].hour * 2) + (params[:issue][:end_time].min/30)\n\n #if (e_time<=s_time) && (e_time == 0 || e_time == 1)\n # #errors.add :due_date, :greater_than_start_date\n # end_time = Issue.time_list[e_time+48] #assuming user knows what he's doing, automatically adjusts the time to next day\n #end\n\n if self.end_time and self.start_time and self.end_time <= self.start_time\n errors.add :due_date, :greater_than_start_date\n end\n\n end", "def check_date\n\t\tif self.hasError\n\t\t\terrors.add(\"\", \"You entered Invalid date: \\n - \"+self.interviewer.name)\n\t\t\t# puts \"===================CHECKDATE===================\"\n\t\telsif Time.at(self.sched_end.to_i) <= Time.at(self.sched_start.to_i)\n\t\t\terrors.add(\"\", \"Start time cannot be greater than end time \\n - \"+self.interviewer.name)\n\t\tend\n\tend", "def must_end_after_it_starts\n if ends_before_it_begins?\n errors.add(:end_on, \"must be after the observance starts\")\n end\n end", "def validate_negative_times\n return true if (time_type != \"penalty\" && time_type != \"gift_given\") || start.nil? || finish.nil?\n if r = start <= finish\n errors.add(:start, \"must come after finish, for penalties\")\n end\n r\n end", "def check_end_date\n # if self.category.eql?(\"appointment\")\n unless self.start_date.nil? or self.end_date.nil?\n if (self.end_date < self.start_date)\n self.category.eql?(\"appointment\")? self.errors.add(' ', 'End Date can\\'t be before Start Date') : self.errors.add(' ', 'Due Date can\\'t be before Start Date')\n end\n if self.end_date == self.start_date\n self.errors.add(' ', 'End Time can not be before start time') if (self.end_date.to_time < self.start_date.to_time)\n end\n end\n # end\n end", "def test_arrival_time_validation\n batch = Batch.new(:id => 80,\n :batchid => 8,\n :date => \"#{Time.now}\",\n :eob => 30,\n :facility_id => 1,\n :arrival_time => \"#{Time.now.yesterday}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\")\n batch.valid?\n assert_equal \"must be within 6 hours window period from current time\", batch.errors.on(\"arrival_time\")\n \n batch = Batch.new(:id => 80,\n :batchid => 8,\n :date => \"#{Time.now}\",\n :eob => 30,\n :facility_id => 1,\n :arrival_time => \"#{Time.now.tomorrow}\",\n :target_time => \"#{Time.now}\",\n :status => \"New\")\n batch.valid?\n assert_equal \"must be within 6 hours window period from current time\", batch.errors.on(\"arrival_time\")\n end", "def time_collision_validation\n\t\tappointments = Appointment.all\n\n\t\t#if duration is equals to 0, it means it is fixed pay. \n\t\t#Here, duration is set to 0 so it will not be validated \n\t\t#This will execute if is_pay_per hour is set to 0\n\t\tif @start_date.present? && @start_time.present? && duration == 0.to_s\n\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\t\t\n\t\t\tappointments.each do |a|\n\t\t\t\t# will ensure that the appointment to compare will not be compared to itself in the database if it exists\n\t\t\t\tif a.id.to_s != @appointment_id.to_s\n\t\t\t\t\t# compare fixed-pay input to pay per hour appointment\n\t\t\t\t\tif a.task.is_pay_per_hour && start_at < a.end_at && start_at >= a.start_at \n\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\terrors.add(:start_date, \"An appointment is already \n\t\t\t\t\t\t\tset at #{a.start_at.strftime(\"%I:%M%p\")}, #{a.start_at.strftime(\"%d/%m/%Y\")} \n\t\t\t\t\t\t\tto #{a.end_at.strftime(\"%I:%M%p\")} on #{a.end_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\tbreak\n\n\n\t\t\t\t\t\t#compare fixed-pay input to fixed pay appointment\n\t\t\t\t\telsif !a.task.is_pay_per_hour && start_at == a.start_at \n\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\terrors.add(:start_date, \"A fixed pay appointment is aleady set at #{a.start_at.strftime(\"%I:%M%p\")}\n\t\t\t\t\t\t\t, #{a.start_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend \t\n\t\t\t\tend \t\n\t\t\tend\n\n\n\t\t\t\t#Here, duration should be present and will be always validated\n\t\t\t\t#This will execute if is_pay_per hour is set to 1\n\t\t\telsif @start_date.present? && @start_time.present? && duration.present?\n\t\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\t\t\tend_at = Time.parse(\"#{@start_date} #{@start_time}\") + (@duration.to_f.hours+ (1.hours))\n\n\t\t\t\tappointments.each do |a|\n\t\t\t\t\t# will ensure that the appointment to compare will not be compared to itself in the database if it exists\n\t\t\t\t\tif a.id.to_s != @appointment_id.to_s\n\t\t\t\t\t\t# compare pay per hour input to pay per hour appointment\n\t\t\t\t\t\tif a.task.is_pay_per_hour && start_at < a.end_at && a.start_at < end_at \n\n\t\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\t\terrors.add(:start_date, \"An appointment already \n\t\t\t\t\t\t\t\texists at #{a.start_at.strftime(\"%I:%M%p\")}, #{a.start_at.strftime(\"%d/%m/%Y\")} \n\t\t\t\t\t\t\t\tto #{a.end_at.strftime(\"%I:%M%p\")} on #{a.end_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\t#compare pay per hour input to fixed pay appointment\n\t\t\t\t\t\telsif !a.task.is_pay_per_hour && a.start_at <= end_at && a.start_at >= start_at\n\n\t\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\t\terrors.add(:start_date, \"A fixed pay appointment is aleady set at #{a.start_at.strftime(\"%I:%M%p\")}\n\t\t\t\t\t\t\t\t, #{a.start_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\t\tbreak\t\t\t\t\n\t\t\t\t\t\tend\t\t\t\n\t\t\t\t\tend \n\t\t\t\tend\n\t\t\tend \n\t\tend", "def validate_time_to_market\n # lead time based on priority!\n today = Date.today\n days = (self.start_date - today).to_i\n if days < LEAD_TIME[self.priority]\n add_validation 'Start date must be at least ' + LEAD_TIME[self.priority].to_s + ' days in advance for ' +\n EngagementRequest::PRIORITIES[self.priority] + ' priority'\n end\n\n # 30 day minimum!\n length = (self.end_date - self.start_date).to_i\n if length < 30\n add_validation 'Projects with a length of less than 30 days will not be considered'\n end\n\n # must start on a Monday and end on a Friday\n if self.start_date.wday != 1\n add_validation 'Start Date must be a Monday'\n end\n if self.end_date.wday != 5\n add_validation 'End Date must be a Friday'\n end\n\n # cost reduction projects!\n cost_reduction = ['Operations Streamlining', 'Manufacturing Efficiency'].include? self.program.name\n if cost_reduction && self.projected_revenue != 0\n add_validation self.program.name + ' is not expected to generate revenue'\n end\n if cost_reduction && ! self.low_risk?\n add_validation self.program.name + ' projects must be low risk'\n end\n\n # potential profit!\n profit = self.projected_revenue - self.budget_allocated\n if ! cost_reduction && profit < RISK_REWARD[self.risk_rating]\n add_validation EngagementRequest::RISK_RATINGS[self.risk_rating] +\n ' risk projects should be expected to produce at least ' +\n number_to_currency(RISK_REWARD[self.risk_rating]) + ' profit'\n end\n\n # risks should be defined! 5 sentences!\n validate_sentences_length 'Risks', self.risks, 100, 500, 5\n end", "def valid_tee_time?(datetime)\n before_5pm = (datetime.hour <= 16 && datetime.min <= 40)\n after_9am = datetime.hour >= 9\n before_end_date = (datetime + 3.hours) <= @end_time\n return before_5pm && after_9am && before_end_date\n end", "def validate_time(time)\n time=~/^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/\nend", "def validate(record)\n if !record.start_time.nil? && !record.end_time.nil? && record.start_time >= record.end_time\n record.errors[:end_time] << 'End date should be greater that start date!'\n end\n \n if !record.start_time.nil? && record.start_time < Time.now\n record.errors[:start_time] << 'Start time must be greater than current time'\n end\n end", "def end\n @end_time = Time.now.utc\n end", "def validate_time(start_time, end_time)\n\t\t\t\ttime_now = Time.now.strftime(\"%m/%d/%Y %H:%M\")\n\t\t\t\tappointments = Appointment.all\n\t\t\t\ttoday = start_time.split[0]\n\t\t\t\ttoday_appts = appointments.where(start_time: today)\n\t\t\t\tresult = false\n\n\t\t\t\tif start_time > time_now\n\t\t\t\t\tif today_appts.length == 0\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t\t\t\t\ttoday_appts.each do |appt|\n\t\t\t\t\t\tif start_time <= appt.end_time && appt.start_time <= end_time\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresult = true\n\t\t\t\t\t\tend\n\t\t\t\t\tend#end of each loop\n\t\t\t\tend#end of if start_time\n\t\t\t\tresult\n\t\t\tend", "def time_cannot_be_in_the_past\n errors.add(:time, \"can't be in the past\") if date == Date.today and !time.blank? and Time.parse(time.strftime(\"%I:%M%p\"))<Time.parse(Time.now.strftime(\"%I:%M%p\"))\n end", "def after(time)\n ~before(time)\n end", "def time_valid\n if self.valid_from and self.valid_to then\n errors.add(:valid_from,\n \"must be before the valid to date. #{self.valid_from} >= #{self.valid_to}\") unless self.valid_from < self.valid_to\n else\n if self.valid_from or self.valid_to then\n errors.add(:valid_from,\n \" must be set when valid_to is set.\") unless self.valid_from\n errors.add(:valid_to,\n \" must be set when valid_from is set.\") unless self.valid_to\n end\n end\n end", "def expected_end\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end", "def valid_appointments(base_time)\n transform_blocks_to_appointments(valid_blocks(base_time))\n end", "def complete_termination\n self.deleted_at = Time.now.utc\n self.end_date = Date.today\n end", "def end_time=(*_args)\n raise_invalid_argument(property_name: :end_time)\n end", "def after?(time)\n start_time > time\n end", "def after?(time)\n start_time > time\n end", "def end_time_input\n @end_time_input || end_time.try(:strftime, \"%H:%M\")\n end", "def valid_at?(time)\n if time.is_a?(Integer)\n time = Time.at(time)\n end\n\n if (self.not_after < time) || (self.not_before > time)\n false\n else\n true\n end\n end", "def timing_order\n if start_time && end_time && end_time < start_time\n errors.add(:end_time, I18n.t('activerecord.errors.models.membership.attributes.end_time.timing_order'))\n end\n end", "def max_9_hrs\n errors.add(:Checkout_Date, \"must be less\") unless\n Return_Date.to_time - Checkout_Date.to_time < 9.to_time\n end", "def meeting_time_later_than_now?\n\t\tif self.meeting_time < DateTime.now\n errors.add(:meeting_time, \"Meeting time must be later than now!\")\n\t\tend\n\tend", "def end_time_defined?(time)\n if time.empty?\n '24:00'\n else\n time\n end\n end", "def is_valid_time?(timeBegin, timeEnd)\n\n\t\t#zone = Timezone.get('America/Chicago').now.zone\n\n\t\t#freebusy method only responds to a couple of months (maybe <=3)\n\t\tresponse = @client.execute(api_method: @service.freebusy.query,\n\t\t\t\t\t body: JSON.dump({\n\t\t\t timeMin: timeBegin,\n\t\t\t timeMax: timeEnd,\n\t\t\t timeZone: 'America/Chicago',\n\t\t\t items:[ id: ENV['NSCS_Calendar_ID']]\n\t\t\t }),\n\t\t\t headers: {'Content-Type' => 'application/json'})\n\t\t@client.authorization.refresh!\n\t\tevents = JSON.parse(response.body)\n\t\t\n\t\t#TODO iteratife over events.\n\t\t\n\tend", "def validate_time_blocks(time_blocks)\n b = time_blocks.select(&:collision_free?)\n\n # Test environment has unreliable data entry for start times.\n b = b.select(&:in_future?) unless Rails.env.test?\n\n b\n end", "def validate_hour_lock(time, schedule)\n hour = value || schedule.start_time.send(type)\n hour = 24 + hour if hour < 0\n if hour >= time.hour\n hour - time.hour\n else\n if dst_offset = TimeUtil.dst_change(time)\n hour - time.hour + dst_offset\n else\n 24 - time.hour + hour\n end\n end\n end", "def validity_period\n super\n end", "def out_of_time\n line\n tab; \"You're out of time, Agent.\\n\".typing\n sleep 1\n tab; \"The mission has been compromised\".typing\n \"....\".typing(0.35)\n sleep 1\n line; line\n tab; \"Get out of there, #{codename}!\\n\".typing\n sleep 1\n tab; \"Run!\\n\".typing\n end", "def valid_blocks(base_time)\n set_base_time(base_time)\n time_entries = time_entries_for(base)\n end", "def valid_venue_time?\n valid_time = self.venue.matches.all? do |match|\n !(match.start_time >= self.start_time && match.start_time <= self.end_time || match.end_time >= self.start_time && match.end_time <= self.end_time)\n end\n errors.add(:start_time, \"The venue is not available for this time\") unless valid_time\n end", "def check_future\n current_start = DateTime.strptime(self.start_time,\"%m/%d/%y %H:%M\").to_time\n current_end = DateTime.strptime(self.end_time,\"%m/%d/%y %H:%M\").to_time \n\n # checks start time of appt is before end time #\n if current_start < current_end\n if current_start > Time.now && current_end > Time.now\n @valid = true\n else\n @valid = false\n end\n end\n @valid\n p @valid\n end", "def validate_check_in_time\n validate_time(params[:check_in][:check_in_time])\n end", "def validate_start_and_stop_time\n if active_time\n if active_start_time.nil? or active_stop_time.nil?\n errors.add(:active_time, \"start time or end time not set\")\n end\n end\n end", "def end_date\n\t \tTime.at(self.end_time) rescue nil\n\t end", "def check_out_date_length\n errors.add(:check_out_at, \"must be less than 12 hours after check in at\") if\n check_out_at > (check_in_at + 12.hours)\n end", "def check_dates\n # TODO the init_time must be less then the end_time\n true\n end", "def valid_after=(_arg0); end", "def verify_end_date(test_data)\n verify_values_match(test_data[CoreUseOfCollectionsData::END_DATE.name], element_value(end_date_input))\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def apply_validations_for_time\n flex_column_class.validates_each field_name do |record, attr, value|\n record.errors.add(attr, \"must be a Time\") if value && (! value.kind_of?(Time))\n end\n end", "def save_end_at\n self.end_time = Time.zone.parse(\"#{date_published} #{@end_time_input}\" ) if ( @end_time_input.present? && date_published.present? )\n end", "def end_date_time\n return @end_date_time\n end", "def end_measures_for(tame)\n Measure.national\n .with_measure_type(tame.measure_type)\n .valid_before(tame.fe_tsmp)\n .with_tariff_measure_number(tame.tar_msr_no)\n .not_terminated\n .each do |measure|\n\n end_date = if (measure.associated_to_non_open_ended_gono? &&\n record.fe_tsmp > measure.goods_nomenclature.validity_end_date)\n measure.goods_nomenclature.validity_end_date\n else\n record.fe_tsmp\n end\n\n update_record(measure,\n validity_end_date: end_date,\n justification_regulation_id: measure.measure_generating_regulation_id,\n justification_regulation_role: measure.measure_generating_regulation_role,\n operation_date: operation_date)\n end\n end", "def validate_future_start_time\n\t\tif start_time <= Time.now\n\t\t\terrors.add(:start_time, \"must be in the future\")\n\t\tend\n\tend", "def terminate_now\n current_assignment = self.student.student_teams.current.first\n if current_assignment.nil?\n return true \n else\n current_assignment.end_date = Date.current\n current_assignment.update_attribute(:end_date, Date.current)\n end\n end", "def stop_clock\n @start_time ||= Time.now # if we failed so early we didn't get a start time\n @end_time = Time.now\n end", "def test_schedule_time_cannot_be_before_current_time\n \t@schedule.start_time = \"2004-05-06 04:36:00\"\n \tassert !@schedule.save, \"Worked? Saved a schedule to position itself in the past.\"\n end", "def time_span\n unless start_date < end_date\n errors.add(:courses, \"Please choose a time span longer than one day.\")\n end\n end", "def end_of(period)\n case period\n when :eternity then change(:year => 9999, :month => 12, :day => 31, :hour => 23, :min => 59, :sec => 59)\n when :day, :week, :month, :year, :hour, :minute then send(\"end_of_#{period}\")\n else raise_invalid_period(period)\n end\n end", "def time_requires_roll?\n !@endTime.nil? && Time.now.to_i >= @endTime\n end", "def verify_end_date(test_data)\n verify_values_match(test_data[UseOfCollections::END_DATE.name], element_value(end_date_input))\n end", "def endTimeFromNow() ;\n return endTimeFrom(Time.new()) ;\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def end_date_time=(value)\n @end_date_time = value\n end", "def validate_time(tweet)\n current = DateTime.now\n five_past = DateTime.new(current.year, current.month, current.day, current.hour, current.min-5, current.sec, \"-05:00\")\n tweet.created_at.to_time.to_i > five_past.to_time.to_i ? true : false\n end", "def shift_start_hour\n if self.start_time.hour > 2 && self.start_time.hour < 7\n errors.add(:start_time, 'must be between 7am and 2am')\n end \n end", "def ensure_on_time!\n time_diff_sec = timestamp.to_i - Time.now.to_i\n\n unless DEADLINE_RANGE.cover?(time_diff_sec)\n if time_diff_sec < 0\n fail(TransactionTimestampTooOld, REPORT_DEADLINE_PAST)\n else\n fail(TransactionTimestampTooNew, REPORT_DEADLINE_FUTURE)\n end\n end\n end" ]
[ "0.6389445", "0.63161683", "0.630917", "0.6272418", "0.62706494", "0.62253946", "0.622534", "0.6204812", "0.6201192", "0.6197278", "0.61787534", "0.6177698", "0.6162016", "0.6134159", "0.6134159", "0.6104135", "0.6083882", "0.60712993", "0.60669905", "0.60382575", "0.602923", "0.6015531", "0.5980281", "0.59781915", "0.59561574", "0.5947121", "0.58947355", "0.58763933", "0.5853182", "0.583933", "0.58270365", "0.5824359", "0.5805099", "0.57884616", "0.577144", "0.57529426", "0.5751753", "0.57488066", "0.57487077", "0.57457685", "0.57418096", "0.5731435", "0.5719291", "0.57051766", "0.5701586", "0.5690413", "0.5663529", "0.56592363", "0.5639143", "0.5632965", "0.56049854", "0.5592526", "0.5589578", "0.5584166", "0.5584166", "0.5577405", "0.55585474", "0.5558423", "0.5552526", "0.55482095", "0.55474937", "0.55416524", "0.55310327", "0.5526616", "0.5509811", "0.5504535", "0.5500077", "0.5495083", "0.54883176", "0.5479795", "0.54752123", "0.547119", "0.5430836", "0.54248804", "0.54178035", "0.54171115", "0.54161793", "0.5394279", "0.538551", "0.5385315", "0.5384823", "0.53836036", "0.53795785", "0.537092", "0.5365613", "0.53581655", "0.5355633", "0.5346962", "0.53422016", "0.53412825", "0.53240895", "0.53240895", "0.53240895", "0.53240895", "0.53240895", "0.53240895", "0.53220886", "0.5319588", "0.5319522", "0.5312425" ]
0.57621694
35
days_of_week Helpers Hash mapping day of week (Symbol) to valid(true)/invalid(false)
def days_of_week_hash @days_of_week_hash ||= { :sunday => (days_of_week & SUNDAY ) > 0, :monday => (days_of_week & MONDAY ) > 0, :tuesday => (days_of_week & TUESDAY ) > 0, :wednesday => (days_of_week & WEDNESDAY ) > 0, :thursday => (days_of_week & THURSDAY ) > 0, :friday => (days_of_week & FRIDAY ) > 0, :saturday => (days_of_week & SATURDAY ) > 0 } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def week_days\n {\n \"1\" => 'mon',\n \"2\" => 'tue',\n \"3\" => 'wed',\n \"4\" => 'thu',\n \"5\" => 'fri',\n \"6\" => 'sat',\n \"7\" => 'sun'\n }\n end", "def days_of_week_are_valid\n errors.add(:days_of_week, \"The days of the week are invalid.\") unless days_of_week_are_valid?\n end", "def days_of_week_are_valid?\n if (self.sunday == nil); return false; end\n if (self.monday == nil); return false; end\n if (self.tuesday == nil); return false; end\n if (self.wednesday == nil); return false; end\n if (self.thursday == nil); return false; end\n if (self.friday == nil); return false; end\n if (self.saturday == nil); return false; end\n\n if ((self.sunday != true) and (self.sunday != false)); return false; end\n if ((self.monday != true) and (self.monday != false)); return false; end\n if ((self.tuesday != true) and (self.tuesday != false)); return false; end\n if ((self.wednesday != true) and (self.wednesday != false)); return false; end\n if ((self.thursday != true) and (self.thursday != false)); return false; end\n if ((self.friday != true) and (self.friday != false)); return false; end\n if ((self.saturday != true) and (self.saturday != false)); return false; end\n return true\n end", "def regular_days_hash(regular_days, date_from, date_to)\n regular_days_hash = {}\n regular_days.each do |day|\n regular_days_hash[day.date.to_s] = day if day.date >= date_from && day.date <= date_to\n end\n regular_days_hash\n end", "def open(day: string)\n \n return { \"wednesday\" => true, \"thursday\" => true, \"friday\" => true, \"saturday\" => true, \"sunday\" => true }.key?(day)\nend", "def valid_day_of_week(str)\n n = str.kind_of?(Numeric) ? str : (DATES_MAP[:day][str.to_s.downcase[0,3]]).to_i\n (n >= 1 and n <= 7) ? n : raise(ArgumentError, \"invalid day of the week `#{str}`\") \n end", "def days_worked\n days = account.account_setting.working_days\n Hash[days.map { |k,v| [k, (v == \"1\")] }]\n end", "def weekday?\n WEEK_DAYS.include? wday\n end", "def days_in_week(*days)\n @test_time = @time if @test_time.nil?\n x_in_list_of_y(@test_time.wday, Configuration.parse_range(days,0...7).flatten)\n end", "def week_to_date_map\n week_of_year = Time.new.strftime(\"%V\").to_i\n week_count = week_of_year.modulo(4) + 1\n\n mapping = {}\n for i in 0..3 do\n date = Date.today.beginning_of_week(:monday)\n date += 1 + ((3-date.wday) % 7)\n date += i.week\n mapping[week_count] = date\n week_count += 1\n week_count = 1 if week_count > 4\n end\n\n mapping[0] = 'On Hold'\n mapping[99] = 'Not Yet Set'\n mapping\n end", "def monthly_weekdays_checked?(week_number, day_number)\n schedule = @issue.planning_schedule\n if schedule\n rule = schedule.recurrence_rules.first.try(:to_hash) || Hash.new\n if rule[:rule_type] == \"IceCube::MonthlyRule\"\n rule[:validations][:day_of_week][week_number].include?(day_number) rescue false\n else\n false\n end\n else\n false\n end\n\n # probably, this method should be written as follows:\n # rule = @issue.planning_schedule.recurrence_rules.first.to_hash\n # rule[:rule_type] == \"IceCube::MonthlyRule\" && rule[:validations][:day_of_week][week_number].include?(day_number)\n # rescue\n # false\n\n end", "def specific_days_in_semester\n date_start = USDateParse(self.start_date)#USDateParse(self.start_date)\n date_end = USDateParse(self.end_date)#USDateParse(self.end_date)\n curr_date = date_start\n date_hash = Hash.new(0)\n while curr_date <= date_end do\n if (! self.individual_dates_with_no_classes.include?(curr_date))\n date_hash[curr_date.cwday] += 1\n end\n curr_date += 1\n end\n return date_hash\n end", "def days_of_week_string\n dow = days_of_week_hash\n\n @days_of_week_string ||=\n (dow[:sunday] ? \"Su\" : \"\") +\n (dow[:monday] ? \"M\" : \"\") +\n (dow[:tuesday] ? \"Tu\" : \"\") +\n (dow[:wednesday] ? \"W\" : \"\") +\n (dow[:thursday] ? \"Th\" : \"\") +\n (dow[:friday] ? \"F\" : \"\") +\n (dow[:saturday] ? \"Sa\" : \"\")\n end", "def weekdays\n value.each_char.map { |c| WEEKDAYS.index(c) }\n end", "def day_of_the_week(day)\n @dias = {1 => \"LUNES\", 2 => \"MARTES\", 3 => \"MIERCOLES\", 4 => \"JUEVES\", 5 => \"VIERNES\", 6 => \"SÁBADO\", 7 => \"DOMINGO\"}\n return @dias[day]\n end", "def _week_day_numbers\n week_day_start = self.week_day_start\n week_day_start.capitalize if week_day_start.is_a? String\n [0, 1, 2, 3, 4, 5, 6].partition {|on| on >= day_names.index(week_day_start)%7 }.flatten\n end", "def validate_week_of\n input_week_of = self.week_of\n # correct day, assuming input week is a Time object\n # http://ruby-doc.org/core-2.2.0/Time.html#method-i-sunday-3F\n return input_week_of.monday?\n end", "def compatability_hash(day,time_block)\n { :day_of_week => day, :start_time => time_block.start_time, :end_time => time_block.end_time }\n end", "def sunday_5_54_plus1\n make_hash(draw(49, 5), draw(11, 1))\n end", "def get_days\n return 0b0 if @params[:type] != 'advanced'\n\n return get_weekday_bitmask(['weekday_sun', 'weekday_mon', 'weekday_tue', 'weekday_wed', 'weekday_thu', 'weekday_fri', 'weekday_sat']) if @params[:schedule] == 'weekly'\n\n return get_month_bitmask(@params[:dates_picked]) if @params[:schedule] == 'monthly' && @params[:days] == 'specific'\n\n return get_unspecific_days\n\n end", "def days_of_week\n\n # create an array for processing\n days_array = [sunday, monday, tuesday, wednesday, thursday, friday, saturday]\n int_array = Array.new\n for day in days_array\n day ? int_array.push(1) : int_array.push(0)\n end\n\n # process with little recursive function\n r(int_array, 0)\n # fix first value, see note below\n int_array[0] == -1 ? int_array[0] = 1 : nil\n\n # final passes, change values into useable string\n int_array[0] == 1 ? int_array[0] = 'Su' : nil\n int_array[1] == 1 ? int_array[1] = 'M' : nil\n int_array[2] == 1 ? int_array[2] = 'Tu' : nil\n int_array[3] == 1 ? int_array[3] = 'W' : nil\n int_array[4] == 1 ? int_array[4] = 'Th' : nil\n int_array[5] == 1 ? int_array[5] = 'F' : nil\n int_array[6] == 1 ? int_array[6] = 'Sa' : nil\n\n int_array.delete(0)\n int_array.map{ |x| x == -1 ? '-' : x}.uniq.join\n\n end", "def weekdays\n wdays = []\n wdays << 0 if sun\n wdays << 1 if mon\n wdays << 2 if tue\n wdays << 3 if wed\n wdays << 4 if thu\n wdays << 5 if fri\n wdays << 6 if sat\n\n wdays\n end", "def days_of_week_array\n dow = days_of_week_hash\n\n @days_of_week_array ||= [\n dow[:sunday],\n dow[:monday],\n dow[:tuesday],\n dow[:wednesday],\n dow[:thursday],\n dow[:friday],\n dow[:saturday]\n ]\n end", "def get_days\n\t\tbool_array = []\n\n\t\tbool_array << self[:monday]\n\t\tbool_array << self[:tuesday]\n\t\tbool_array << self[:wednesday]\n\t\tbool_array << self[:thursday]\n\t\tbool_array << self[:friday]\n\t\tbool_array << self[:saturday]\n\t\tbool_array << self[:sunday]\n\n\t\treturn bool_array\n\tend", "def get_week_hash current_day\n monday_idx = current_day_id + 1 - current_day\n {monday: people.find(person_order[monday_idx]).name,\n tuesday: people.find(person_order[monday_idx + 1]).name,\n wednesday: people.find(person_order[monday_idx + 2]).name,\n thursday: people.find(person_order[monday_idx + 3]).name,\n friday: people.find(person_order[monday_idx + 4]).name}\n end", "def day_rule\n @day_rules[@this_day.key_by_date] || @day_rules[@this_day.key_by_day]\n end", "def weekend(day)\n case\n\n when day == 'Saturday'\n return true\n when day == 'Sunday'\n return true\n else\n return false\n\nend\nend", "def hash\n [period, rrule, type, until_date, until_occurrences, week_days].hash\n end", "def check_day(d)\n\tif !$days.include?(d)\n\t\tputs \"================\"\n\t\tputs \"ERROR MESSAGE!!!\"\n\t\tputs \"\"\n\t\tputs \"Days of the week are:\"\n\t\tputs \"Monday\"\n\t\tputs \"Tuesday\"\n\t\tputs \"Wednesday\"\n\t\tputs \"Thursday\"\n\t\tputs \"Friday\"\n\t\tputs \"Saturday\"\n\t\tputs \"Sunday\"\n\t\traise \"Invalid day entered!\"\n\tend\n\t\n\t# Set the day\n\tset_index_for_cur_day($days.index(d))\nend", "def odd_week?; (to_i / 7.days).odd? end", "def on_weekday?\n !WEEKEND_DAYS.include?(wday)\n end", "def check_day_of_week\n if (selected_days.size - 1) > 0 && !selected_days.nil?\n d = Date.today\n weekday = Date::DAYNAMES[d.wday]\n selected_days.include?(weekday)\n else\n return true\n end\n end", "def has_sunday_with_date_7(month, year)\n calender = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n day_count = 0\n\n calender.each do |num|\n (1..num).each do |i|\n if i == 7 && day_count = 7\n return true\n end\n if day_count <= 7\n day_count += 1\n else\n day_count = 7\n end\n end\n end\nend", "def weekend_day_number?(day_number)\n @weekend.include?(day_number)\n end", "def holiday_cannot_be_on_weekends\n if (self.date.cwday == 6 or self.date.cwday == 7)\n errors.add(:date, \"Holiday should not be on weekends\")\n end\n end", "def day_of_week\n # Zellers: 0 = Saturday, 1 = Sunday, 2 = Monday, ..., 6 = Friday\n # day_of_week: 1 = Sunday, 7 = Saturday\n (zellers_congruence + 6) % 7\n end", "def set_days_of_week\n @days_of_week = Date::DAYNAMES.each_with_index\n end", "def match_week\n @week ? { 'fiscal_week_id' => @week.to_i } : {}\n end", "def day_of_week\n Date::DAYNAMES.fetch(recurring_event.day).downcase.to_sym\n end", "def valid?(v)\n day?(v)\n end", "def day_of_week\n dnum = day\n dnum -= 10 if dnum > 20\n dnum -= 10 if dnum > 10\n dnum -= 1\n dnum\n end", "def holiday_cannot_be_on_weekends\n if (self.date.strftime(\"%u\") == \"6\" or self.date.strftime(\"%u\") == \"7\")\n errors.add(:date, \"Holiday should not be on weekends\")\n end\n end", "def week_day_conflict?(event)\n @start.wday == event.start.wday\n end", "def translate_day_of_week( day )\n days = { :Mon => \"Понедельник\", :Tue => \"Вторник\", :Wed => \"Среда\", :Thu => \"Четверг\",\n :Fri => \"Пятница\" }\n days[ day.to_sym ]\n end", "def validate_dow(spec)\n spec = spec.to_s\n spec == \"*\" ||\n validate_numeric(spec, 0, 7) ||\n %w{sun mon tue wed thu fri sat}.include?(spec.downcase) ||\n %w{sunday monday tuesday wednesday thursday friday saturday}.include?(spec.downcase)\n end", "def working_day?\n !week_end?\n end", "def monday_check?(start_date)\n new_week = Date.parse(start_date)\n if new_week.strftime('%A') == \"Monday\"\n true\n else\n false\n end\nend", "def weekday?(day)\n\t\tday && (EXISTING_PATTERNS[:weekdays].split('|').include? day)\n\tend", "def pbIsWeekday(wdayVariable,*arg)\n timenow = pbGetTimeNow\n wday = timenow.wday\n ret = false\n for wd in arg\n ret = true if wd==wday\n end\n if wdayVariable>0\n $game_variables[wdayVariable] = [ \n _INTL(\"Sunday\"),\n _INTL(\"Monday\"),\n _INTL(\"Tuesday\"),\n _INTL(\"Wednesday\"),\n _INTL(\"Thursday\"),\n _INTL(\"Friday\"),\n _INTL(\"Saturday\")][wday] \n $game_map.need_refresh = true if $game_map\n end\n return ret\nend", "def to_hash\n hash = {\n 'frequency' => frequency,\n 'day_of_week' => day_of_week\n }\n hash['start_at'] = start_at.xmlschema if start_at\n hash['end_on'] = end_on.xmlschema if end_on\n hash\n end", "def days_of_week_between(day_of_week, start_date, end_date)\n ((start_date..end_date).select{ |d| d.wday == day_of_week }).count\n end", "def is_day_number_a_sunday(number)\n # where 1 is '1 Jan 1900'\n # and 2 is '2 Jan 1900'\n return true if (number + 7) % 7 == 0\n return false\nend", "def weekend?\n wday == 0 || wday == 6\n end", "def day_of_week\n # Date.wday returns 0-6 for Sunday,...Saturday\n return @day.wday\n end", "def weekend?\n [0, 6].include?(date.wday)\n end", "def day_of_week\n randomize(Date::DAYNAMES)\n end", "def day_of_week\n randomize(Date::DAYNAMES)\n end", "def hash\n [calendar_type, deleted_instance_dates, end_date, end_type, exceptions, frequency, modified_instance_dates, occurrence_count, pattern_type, period, sliding_flag, start_date, week_start_day, discriminator, day_of_week].hash\n end", "def includesDay(weekDay)\r\n if !@start_day.nil?\r\n if @end_day.nil? \r\n @start_day == weekDay\r\n elsif @start_day < @end_day \r\n @start_day <= weekDay and weekDay <= @end_day\r\n else\r\n @start_day <= weekDay and weekDay <= (@end_day + 7)\r\n end\r\n else\r\n true\r\n end\r\n end", "def perfectDayChecker day\n\t\t\t# If all five prayers were performed\n\t\t\tif day[:fajr] == 2 && day[:zuhr] == 2 && day[:asr] == 2 && day[:maghrib] == 2 && day[:isha] == 2\n\t\t\t \ttrue \t# Return true\n\t\t\telse\n\t\t\t\tfalse\t# Return false\n\t\t\tend\n\t\tend", "def hash_days_number year\n hash = { 1 => 31, 2 => 28, 3 => 31, 4 => 30, 5 => 31, 6 => 30,\n 7 => 31, 8 => 31, 9 => 30, 10 => 31, 11 => 30, 12 => 31 }\n\n hash[2] = 29 if leap? year\n hash\nend", "def day_of_week(date)\n 7 - date.cwday\n end", "def day_of_week(*weekdays)\n merge(day: weekdays)\n end", "def days_of_the_week_params\n params.require(:days_of_the_week).permit(:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday, :chore_id)\n end", "def on_weekend?\n WEEKEND_DAYS.include?(wday)\n end", "def weekend_and_holiday(day)\n holiday = Holidays.on(day, :federal_reserve, :observed).any?\n weekend = day.saturday? || day.sunday?\n [weekend, holiday]\n end", "def weekday(days)\nt = Date.today\narr = []\n days.times do\n arr << \"ok\" if t.saturday? || t.sunday?; t = t - 1\n end\n arr.count\nend", "def unlucky_days(year)\r\n (1..12).count { |month| Time.new(year, month, 13).friday? }\r\n end", "def non_working_week_days\n @non_working_week_days ||= begin\n days = [] # Setting.non_working_week_days\n if days.is_a?(Array) && days.size < 7\n days.map(&:to_i)\n else\n []\n end\n end\n end", "def valid?\n return false if !@day.nil? && @day > 7\n return false if !@day.nil? && @day < 1\n true\n end", "def duplicate_days\r\n duplicates = 0\r\n dup_hash(self.days_assigned).each_value{|v| duplicates += v}\r\n return duplicates\r\n end", "def on_weekend?\n wday.in?(WEEKEND_DAYS)\n end", "def hash\n [day, from, to].hash\n end", "def weekly_availability\n return [] if course.nil?\n\n availability = [\n { day: 'monday', count: 0, start_times: [] },\n { day: 'tuesday', count: 0, start_times: [] },\n { day: 'wednesday', count: 0, start_times: [] },\n { day: 'thursday', count: 0, start_times: [] },\n { day: 'friday', count: 0, start_times: [] },\n { day: 'saturday', count: 0, start_times: [] },\n { day: 'sunday', count: 0, start_times: [] }\n ]\n\n course.plannings.order('start_time ASC, end_time ASC').each do |planning|\n next if planning.week_day.nil? or Date::DAYNAMES[planning.week_day].nil?\n course_day = Date::DAYNAMES[planning.week_day].downcase\n day_availability = availability.detect { |d| d[:day] == course_day }\n\n day_availability[:count] += 1\n day_availability[:start_times] << I18n.l(planning.start_time, format: :short) if planning.start_time\n end\n\n availability\n end", "def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end", "def find_valid_row(week)\n week = week.split(' - ')\n\n begin\n week_start_day = Date.strptime(week[0].strip, \"%d.%m.%y\")\n week_end_day = Date.strptime(week[1].strip, \"%d.%m.%y\")\n rescue ArgumentError\n return false\n end\n\n return ( week_start_day == self.beginning_of_week ) && ( week_end_day == self.end_of_week )\n end", "def business_days\n @business_days ||= days.select(&:business_day?)\n end", "def closed(day)\n week.each do |weekday,hours_array|\n if day == weekday \n week[weekday] = [\"closed\"]\n \n end\n end\n end", "def day_meetings\n days = []\n @course.weekdays.each_char.each_with_index do |w, i|\n days.push(DAYS_AS_SYM[i]) if w.to_i == 1\n end\n days\n end", "def day_of_week\n return -1 if self.day_of_year == 308\n result = self.days_since_epoch % 8\n if result > 0\n result\n else\n 8\n end\n\n end", "def day_in_week(args = nil)\n if args\n args.each do |key, val|\n case key\n when :mfirst\n else\n raise ArgumentError, \"Invalid key in arguments: '#{key}'.\"\n end\n end\n end\n \n #This is a monday - 0. Use this date to calculate up against.\n def_date = Datet.new(1970, 1, 4)\n \n if self > def_date\n days = Datet.days_between(def_date, self)\n factor = days.to_f / 7.0\n diw = days - (factor.floor * 7)\n else\n days = Datet.days_between(self, def_date)\n factor = days.to_f / 7.0\n diw = days - (factor.floor * 7)\n diw = 7 - diw\n diw = 0 if diw == 7\n end\n \n #Monday should be the first day in the week.\n if args and args[:mfirst]\n if diw == 0\n diw = 6\n else\n diw -= 1\n end\n end\n \n return diw\n end", "def day_in_week_int \n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(today.to_i)\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(today.to_i - e*day_second)\n\t\tend\n\n\t\tdays.sort\n\tend", "def day_of_the_week(time)\n Date::DAYNAMES[time.wday]\nend", "def flags\n ( (override ? 1 : 0) << 7) | read_attribute(:days_of_week)\n end", "def defineSaturdaySundayAndWendnesdayAsHoliday\n Setting['plugin_redmine_workload']['general_workday_monday'] = 'checked';\n Setting['plugin_redmine_workload']['general_workday_tuesday'] = 'checked';\n Setting['plugin_redmine_workload']['general_workday_wednesday'] = '';\n Setting['plugin_redmine_workload']['general_workday_thursday'] = 'checked';\n Setting['plugin_redmine_workload']['general_workday_friday'] = 'checked';\n Setting['plugin_redmine_workload']['general_workday_saturday'] = '';\n Setting['plugin_redmine_workload']['general_workday_sunday'] = '';\n end", "def day_not_valid?\n return impossible_day_number? && wrong_day_number_in_month\n end", "def weekday\n fail \"A value cannot be provided for #{__method__}\" if @value\n return 'Mon..Fri'\n end", "def validate_day(spec)\n validate_numeric(spec, 1, 31)\n end", "def return_static_day(myday,day_map,human_label)\n\n static_day=myday\n my_1day=(60*60*24) #1 day in seconds\n\n #static holiday\n if ( myday.wday != day_map['sun'] and myday.wday != day_map['sat']) #not on a weekend\n static_day=(\"#{(myday).to_i}:#{human_label}\")\n elsif myday.wday == day_map['sun'] #push Monday after\n static_day=(\"#{(myday+my_1day).to_i}:#{human_label} Monday After\")\n elsif myday.wday == day_map['sat'] #Friday before\n static_day=(\"#{(myday-my_1day).to_i}:#{human_label} Friday Before\")\n else\n #we shouldn't see anything here\n end\n return static_day\nend", "def day?(day)\n return (day_num_elem?(day) or day_sym_elem?(day) or day.day_sym? or day.day_num?)\nend", "def day_in_week_str\n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(formatted(today))\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(formatted(Time.at(today.to_i - e*day_second)))\n\t\tend\n\n\t\tdays.sort\n\tend", "def contains_day?(day)\n (self.start_day <= day) and (day < self.start_day + 7.days)\n end", "def getWdayForPublicHday(startDate)\n\t\tpHdays = getPublicHolidays()\n\t\twDayOfPublicHoliday = Array.new\n\t\tif !pHdays.blank?\t\t\n\t\t\tfor i in 0..6\n\t\t\t\twDayOfPublicHoliday << ((startDate+i).cwday).to_s if checkHoliday((startDate + i).to_s,pHdays)\n\t\t\tend\n\t\tend\t\n\t\twDayOfPublicHoliday\n\tend", "def check_day(meet_days_integer,day_to_check)\n\n day_shift = {monday: 0, tuesday: 1, wednesday: 2, thursday: 3, friday: 4, saturday: 5, sunday:6}\n\n# puts \"day_to_check = #{day_to_check}\"\n# puts \"day_shift[:tuesday] = #{day_shift[:tuesday]}\"\n# puts \"day_shift[day_to_check] = #{day_shift[day_to_check]}\"\n day_shift_int = day_shift[day_to_check].to_i\n# puts \"day_shift_int = #{day_shift_int}\"\n shifted_int = ( meet_days_integer >> day_shift_int ).to_s(2)\n# puts \"shifted_int = #{shifted_int}\"\n day_checked = shifted_int.to_i % 2\n# puts \"day_checked = #{day_checked}\"\n return day_checked.to_s\nend", "def potential_working_days(start_date, end_date)\n days_worked = (start_date..end_date).select do |day|\n day = day.strftime(\"%A\").downcase.to_sym\n works_on?(day)\n end\n days_worked.count\n end", "def general\n @week == 0 ? true : false\n end", "def calendar (holidays, dates)\r\n\t\tif (holidays.length === dates.length)\r\n\t\t\thash = {}\r\n\t\t\t0.upto(holidays.length - 1).each do |index|\r\n\t\t\t\thash[holidays[index]] = dates[index]\r\n\t\t\tend\r\n\r\n\t\t\treturn hash\r\n\t\telse\r\n\t\t\traise \"Array lengths don't match\"\r\n\t\tend\r\n\tend", "def weekday\n fail \"A value cannot be provided for #{__method__}\" if @value\n\n 'Mon..Fri'\n end", "def dayIs(aDay)\n unless aDay == 'Saturday' || aDay == 'Sunday'\n daytype = 'weekday'\n else\n daytype = 'weekend'\n end\n daytype\nend", "def test_is_a_weekend?(p_date = Date.today)\n p_date.saturday? || p_date.sunday?\n end" ]
[ "0.7101164", "0.68387413", "0.66913855", "0.6580827", "0.645476", "0.6395663", "0.62980866", "0.61266935", "0.61141163", "0.6081505", "0.60686713", "0.6054797", "0.60448176", "0.6013568", "0.6002565", "0.598655", "0.5983415", "0.59625745", "0.5904272", "0.5893466", "0.58848304", "0.5867218", "0.5865659", "0.5858609", "0.58564055", "0.57855576", "0.5772622", "0.5765642", "0.5760092", "0.57235134", "0.57128066", "0.5709702", "0.56537247", "0.5653595", "0.56519336", "0.56348693", "0.5603497", "0.5598853", "0.5594128", "0.55869365", "0.5572523", "0.55700946", "0.55552137", "0.5547596", "0.55471283", "0.55287516", "0.5519864", "0.5500716", "0.54920727", "0.54886806", "0.548325", "0.5477324", "0.546987", "0.5465703", "0.5454387", "0.5449063", "0.5449063", "0.5442854", "0.54378194", "0.5436307", "0.5431172", "0.54206765", "0.5420336", "0.5418782", "0.54027957", "0.5386069", "0.53783303", "0.5377947", "0.5374434", "0.53611124", "0.53604484", "0.5359278", "0.535768", "0.5356819", "0.53437173", "0.5341428", "0.5336775", "0.5325141", "0.53234714", "0.5313092", "0.528871", "0.5284976", "0.5276484", "0.52693087", "0.52684295", "0.5256328", "0.5255114", "0.5249797", "0.5246449", "0.5242436", "0.5223193", "0.5210607", "0.52072746", "0.52032524", "0.5201953", "0.5201632", "0.51976466", "0.51955944", "0.5194516", "0.5194196" ]
0.81110364
0
Array beginning with Sunday of valid(true)/inactive(false) values
def days_of_week_array dow = days_of_week_hash @days_of_week_array ||= [ dow[:sunday], dow[:monday], dow[:tuesday], dow[:wednesday], dow[:thursday], dow[:friday], dow[:saturday] ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_days\n\t\tbool_array = []\n\n\t\tbool_array << self[:monday]\n\t\tbool_array << self[:tuesday]\n\t\tbool_array << self[:wednesday]\n\t\tbool_array << self[:thursday]\n\t\tbool_array << self[:friday]\n\t\tbool_array << self[:saturday]\n\t\tbool_array << self[:sunday]\n\n\t\treturn bool_array\n\tend", "def weekdays\n wdays = []\n wdays << 0 if sun\n wdays << 1 if mon\n wdays << 2 if tue\n wdays << 3 if wed\n wdays << 4 if thu\n wdays << 5 if fri\n wdays << 6 if sat\n\n wdays\n end", "def weekday(days)\nt = Date.today\narr = []\n days.times do\n arr << \"ok\" if t.saturday? || t.sunday?; t = t - 1\n end\n arr.count\nend", "def week_split\n days_array.each_slice(7).to_a\n end", "def non_working_week_days\n @non_working_week_days ||= begin\n days = [] # Setting.non_working_week_days\n if days.is_a?(Array) && days.size < 7\n days.map(&:to_i)\n else\n []\n end\n end\n end", "def get_biweek()\n a = []\n week_days = DAYS.map { |day| day[:day] }\n @schedule.each_with_index do |row, i|\n row = row.compact.map { |a| a.upcase }\n if row.all? { |word| week_days.include?(word) } && row != []\n a.push(i + 1)\n end\n end\n return a\nend", "def weekdays\n value.each_char.map { |c| WEEKDAYS.index(c) }\n end", "def _week_day_numbers\n week_day_start = self.week_day_start\n week_day_start.capitalize if week_day_start.is_a? String\n [0, 1, 2, 3, 4, 5, 6].partition {|on| on >= day_names.index(week_day_start)%7 }.flatten\n end", "def day_array(add_pick)\n\t\tret = (0..6).map {|num| [Date::DAYNAMES[num], num]}\n\t\tret.unshift([\"<< Pick >>\",nil]) if add_pick\n\t\tret\n\tend", "def days_of_week\n\n # create an array for processing\n days_array = [sunday, monday, tuesday, wednesday, thursday, friday, saturday]\n int_array = Array.new\n for day in days_array\n day ? int_array.push(1) : int_array.push(0)\n end\n\n # process with little recursive function\n r(int_array, 0)\n # fix first value, see note below\n int_array[0] == -1 ? int_array[0] = 1 : nil\n\n # final passes, change values into useable string\n int_array[0] == 1 ? int_array[0] = 'Su' : nil\n int_array[1] == 1 ? int_array[1] = 'M' : nil\n int_array[2] == 1 ? int_array[2] = 'Tu' : nil\n int_array[3] == 1 ? int_array[3] = 'W' : nil\n int_array[4] == 1 ? int_array[4] = 'Th' : nil\n int_array[5] == 1 ? int_array[5] = 'F' : nil\n int_array[6] == 1 ? int_array[6] = 'Sa' : nil\n\n int_array.delete(0)\n int_array.map{ |x| x == -1 ? '-' : x}.uniq.join\n\n end", "def one_sp_day(obs)\n [obs, false]\nend", "def has_sunday_with_date_7(month, year)\n calender = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n day_count = 0\n\n calender.each do |num|\n (1..num).each do |i|\n if i == 7 && day_count = 7\n return true\n end\n if day_count <= 7\n day_count += 1\n else\n day_count = 7\n end\n end\n end\nend", "def business_days\n @business_days ||= days.select(&:business_day?)\n end", "def to_a\n (first_calendar_day..last_calendar_day).to_a.in_groups_of(7)\n end", "def day_meetings\n days = []\n @course.weekdays.each_char.each_with_index do |w, i|\n days.push(DAYS_AS_SYM[i]) if w.to_i == 1\n end\n days\n end", "def weekend\n [saturday, sunday]\n end", "def weekdays\n if @range\n first = WEEKDAYS.find {|key,val| key.include? @range.first }.last.first\n last = WEEKDAYS.find {|key,val| key.include? @range.last }.last.last\n return (first..last).to_a\n else\n output = []\n @tokens.each do |token|\n WEEKDAYS.each_pair do |labels,wdays|\n output.concat(wdays) and break if labels.include?(token)\n end\n end\n output\n end\n end", "def public_holidays_to_array\n holidays = []\n public_holidays&.each do |day, meta|\n next if !meta\n next if !meta['active']\n next if meta['removed']\n\n holidays.push Date.parse(day)\n end\n holidays\n end", "def days_indecies=(values)\n array = Array.new(7, false)\n\n values.each do |index|\n array[index.to_i] = true\n end\n\n self[:days] = array\n end", "def valid_month_interval(arr)\n if k = DATES_MAP[:cardinals][arr.first] \n [k, valid_day_of_week(arr.last)]\n else\n arr.slice(0,1).map {|v| valid_month_date(v) }.uniq.sort\n end\n end", "def month_week_result_array(day)\n first_week_length = (7 - (day.wday + 6) % 7)\n data = month_result_string(day)\n [\n data[0..first_week_length - 1],\n data[first_week_length..7 + first_week_length - 1],\n data[first_week_length + 7..14 + first_week_length - 1],\n data[first_week_length + 14..21 + first_week_length - 1],\n data[first_week_length + 21..28 + first_week_length - 1],\n data[first_week_length + 28..35 + first_week_length - 1]\n ].compact\n end", "def count_sundays(first, last)\r\n (first..last).select { |n| n.sunday? && n.mday == 1 }.size\r\nend", "def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end", "def weekdays\n result = veeamconfig('schedule', 'show', '--jobId', get_job_id).lines\n\n if result[0].strip == 'Every day'\n ['daily']\n else\n result[0].strip.split(': ')[1].split(', ')\n end\n end", "def holidayChecker(dates, bank_holidays)\n dates = parseDates(dates) #parse dates array\n bank_holidays = parseDates(bank_holidays) #parse bank holidays array\n corrected_schedule = []\n dates.each do |date|\n while date.wday == 6 || date.wday == 7 || bank_holidays.include?(date) #while the date is either a bank holiday OR a Saturday OR a Sunday...\n date += 1\n end\n corrected_schedule.push(date)\n end\n puts corrected_schedule\nend", "def getSundays(d1,d2)\n d1 += 1 while (d1.wday != 0) # add days till starting on sunday\n sundays = []\n d1.step(d2,7) do |date| # move forward seven days for every sunday\n sundays .push date\n end\n sundays\nend", "def to_day_1_7(day_0_6)\n [7,1,2,3,4,5,6,7][day_0_6.to_i] if [0,1,2,3,4,5,6,7].include? day_0_6\n end", "def apps_for_day(date)\n res = Set.new []\n unless date.saturday? or date.sunday?\n @market_apps.each do |market, apps|\n res = res + apps unless @holidays[date] and @holidays[date].include? market\n end\n end\n res\n end", "def allDay\n FALSE\n end", "def month_week_pattern\n week_pattern.map.with_index { |val,idx| Array.new(val,idx+1) }.flatten\n end", "def each_sunday( n=1, offset=0, dur=1); each_wdays(self.Sun,n,offset,dur); end", "def sunday?\n return date.sunday?\n end", "def build_day_array(year, month)\n day_array = Array.new\n # cycle through number of days in the month and build an array with one entry per day\n for d in (1..self.days_in_month(year, month))\n day_array[d] = Line_Calendar::ABBR_DAYNAMES[self.day_in_month(year, month, d)] # populates array with abbreviated daynames\n end\n # remove the 0 entry and move everything up one\n day_array.shift\n return day_array\n end", "def test_should_return_every_day_of_month_as_array\n assertion = Month.april(2003).every(:tuesday)\n assert_equal assertion.size, 5\n assert_equal assertion, [Date.new(2003,4,1),Date.new(2003,4,8),Date.new(2003,4,15),Date.new(2003,4,22),Date.new(2003,4,29)]\n end", "def active_weekdays\n WeekdayConfigVariable.new(name: 'ACTIVE_WEEKDAYS').weekdays\n end", "def list_days\n\t\td = [\"Mondays,\", \"Tuesdays,\", \"Wednesdays,\", \"Thursdays,\", \"Fridays,\", \"Saturdays,\", \"Sundays,\"]\n\t\tx = []\n\n\t\tboolDays = get_days\n\n\t\tfor i in 0..d.length\n\t\t\tif boolDays[i] == true\n\t\t\t\tx << d[i]\n\t\t\tend\n\t\tend\n\t\tx.insert(x.length - 1, \"and\")\n\t\treturn (x*\" \").chop\n\tend", "def all_week(start_day = Date.beginning_of_week)\n beginning_of_week(start_day)..end_of_week(start_day)\n end", "def should_run?\n date.sunday?\n end", "def availdays(av)\n avail_day_1=false\n avail_day_1=true if (av&1)==1\n end", "def create_date_value\n \n 1.upto(months.length) do |month|\n 1.upto(month) do |day|\n arr << [\"2015#{day}#{month}\", day_of_week]\n end\n end\nend", "def test_should_retun_every_set_of_days_of_month_as_array\n assertion = Month.august(2006).every(:monday,:wednesday)\n # verify\n assert assertion.is_a?(Array)\n # check for data integrity\n assert_equal assertion.size, 9\n assert_equal assertion, [Date.new(2006,8,2),Date.new(2006,8,9),Date.new(2006,8,16),Date.new(2006,8,23),Date.new(2006,8,30),Date.new(2006,8,7),Date.new(2006,8,14),Date.new(2006,8,21),Date.new(2006,8,28)]\n end", "def in_transit_days\n \tresult = []\n \tdelivery_duration.times do |num|\n active_day = num_to_day((day_to_num(self.order_day) + num) % 7)\n \t\tresult << active_day if active_day != self.order_day && active_day != self.delivery_day\n \tend\n \tresult\n end", "def current_week\n week_split.select { |c| c.include?(day) }.flatten\n end", "def events_seven_days()\n events = []\n today = Date.today\n for i in 0..6 do\n events += events_by_date(today + i)\n end\n return events\nend", "def all_non_week_days_of_month\n ending_of_month.downto(beginning_of_month).select(&:week_end?)\n end", "def check_available_dates(dress_size, month, year)\n\t\tdates = []\n\t\tstart_date = Date.parse(\"#{year}-#{month}-1\")\n\t\tend_date = start_date.end_of_month\n\t\tfor date in start_date..end_date\n\t\t\tif can_make_reservation?(dress_size, date) and !date.saturday? and !date.sunday?\n\t\t\t\tdates << date\n\t\t\tend\n\t\tend\n\t\treturn dates\n\tend", "def day_in_week_int \n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(today.to_i)\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(today.to_i - e*day_second)\n\t\tend\n\n\t\tdays.sort\n\tend", "def day_in_week_str\n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(formatted(today))\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(formatted(Time.at(today.to_i - e*day_second)))\n\t\tend\n\n\t\tdays.sort\n\tend", "def allDay\n false\n end", "def all_day ; true ; end", "def days_of_week_hash\n @days_of_week_hash ||= {\n :sunday => (days_of_week & SUNDAY ) > 0,\n :monday => (days_of_week & MONDAY ) > 0,\n :tuesday => (days_of_week & TUESDAY ) > 0,\n :wednesday => (days_of_week & WEDNESDAY ) > 0,\n :thursday => (days_of_week & THURSDAY ) > 0,\n :friday => (days_of_week & FRIDAY ) > 0,\n :saturday => (days_of_week & SATURDAY ) > 0\n }\n end", "def format_body\n #convert to ISO date\n d = ((@first_wkday_of_month+5) % 7) + 1\n\n #reset for Sunday\n if d == 7\n d = 0\n end\n\n #returns very long array\n padding = Array.new(d, nil)\n result = (padding + array_of_days).each_slice(7).to_a\n until result.length == 6\n result << [nil]\n end\n result\n end", "def sundays(arr, value)\n count = 0\n arr.each { |n|\n count += 1 if (n + value) % 7 == 0\n }\n return count\nend", "def trucks_open_today\n trucks = self.class.get_truck_data\n date = self.class.get_time\n\n trucks_today = []\n trucks.each do |truck|\n if date.strftime(\"%A\") == truck[\"dayofweekstr\"]\n trucks_today << truck[\"applicant\"]\n end \n end\n p trucks_today\n end", "def beginning_of_week; end", "def beginning_of_week; end", "def sunday_weekly_batch\n JdeFetch.checking_buffer\n JdeFetch.checking_item_cost\n end", "def week_days\n {\n \"1\" => 'mon',\n \"2\" => 'tue',\n \"3\" => 'wed',\n \"4\" => 'thu',\n \"5\" => 'fri',\n \"6\" => 'sat',\n \"7\" => 'sun'\n }\n end", "def weekly_availability\n return [] if course.nil?\n\n availability = [\n { day: 'monday', count: 0, start_times: [] },\n { day: 'tuesday', count: 0, start_times: [] },\n { day: 'wednesday', count: 0, start_times: [] },\n { day: 'thursday', count: 0, start_times: [] },\n { day: 'friday', count: 0, start_times: [] },\n { day: 'saturday', count: 0, start_times: [] },\n { day: 'sunday', count: 0, start_times: [] }\n ]\n\n course.plannings.order('start_time ASC, end_time ASC').each do |planning|\n next if planning.week_day.nil? or Date::DAYNAMES[planning.week_day].nil?\n course_day = Date::DAYNAMES[planning.week_day].downcase\n day_availability = availability.detect { |d| d[:day] == course_day }\n\n day_availability[:count] += 1\n day_availability[:start_times] << I18n.l(planning.start_time, format: :short) if planning.start_time\n end\n\n availability\n end", "def days_in_week(*days)\n @test_time = @time if @test_time.nil?\n x_in_list_of_y(@test_time.wday, Configuration.parse_range(days,0...7).flatten)\n end", "def week_pattern\n year_weeks == 53 ? [5,4,5]+[4,4,5]*3 : [4,4,5]*4\n end", "def get_calendar\n\t# 日付情報を格納する配列を宣言\n\tcal_data = Array.new(0)\n\n\t(1..@wday.length - 1).each do |day|\n\t\t# 曜日がnilになったら月が終わりなのでbreak\n\t\tif @wday[day] == nil\n\t\t\tbreak\n\t\tend # if\n\n\t\t# 日付と曜日番号をひとつの配列にする\n\t\tday_data = [\"#{day}\", @wday[day]]\n\n\t\t# 日付情報に日付と曜日番号の配列を追加\n\t\tcal_data << day_data\n\tend # each\n\n\t# 日付情報を返却\n\treturn cal_data\nend", "def add_and_return_array(data)\n # Create new array\n days = []\n # Loop through dates\n (1.week.ago.to_date..Date.today).each do |date|\n # Set datetime to beginning of day\n date = date.midnight\n # Push to hash into array\n days << { m: date, a: data[date] }\n end\n # return days as array\n days\n end", "def is_sunday?(days_since_1900)\n # Monday was 1st, so Sunday is when 7 divides evenly into number of days\n # since the known Monday\n (days_since_1900 % 7 == 0)\nend", "def nth_monday (vjd, time)\n nth = vjd.frequency.week\n day = time.wday # sunday ==0\n week_one_size = time.week_split[0].size\n # [[1,2,3,4],[]] # not sun, mon, tue... 7 - size = 3 > 0,1,2 \n if 7 - week_one_size > day &&\n nth == time.week_of_month\n return true\n elsif(nth == time.week_of_month-1)\n return true\n else\n return false\n end\n end", "def betweenDates(index,week)\n if (index <= week[4].to_i)\n return week\n end\n return []\nend", "def closed(day)\n week.each do |weekday,hours_array|\n if day == weekday \n week[weekday] = [\"closed\"]\n \n end\n end\n end", "def getFirstSundays(d1,d2)\n d1 += 1 while (d1.mday != 1) unless d1.mday == 1\n firstSundays = []\n while d1 < d2\n d1 = d1 >> 1 # add a month\n firstSundays .push d1 if d1.wday == 0\n end\n firstSundays\nend", "def weekloop(sday,looptime,loopday)\r\n @sday = sday.to_date\r\n if @sday.wday < loopday\r\n @sday = @sday + (loopday - @sday.wday)\r\n elsif @sday.wday > loopday\r\n @sday = @sday - (@sday.wday - loopday) + 7\r\n end\r\n dayarray = []\r\n dayarray << @sday.to_s\r\n for i in 1...looptime do\r\n @sday = @sday + 7\r\n dayarray << @sday.to_date.to_s\r\n end\r\n return dayarray\r\n end", "def has_sunday_with_date_7(month, year)\n Date.new(year, month, 7).downto(0).find(&:sunday?)\n return true\nend", "def set_days_of_week\n @days_of_week = Date::DAYNAMES.each_with_index\n end", "def report_regular_month_array(now = DateTime.now)\n # size 12 array: the last 12 months\n return self.hours_year_array(now).map do |hrs|\n hrs >= MIN_REGULAR_MONTHLY_HOURS ? true : false\n end\n end", "def sunday\n end_of_week(:monday)\n end", "def sunday\n day(:sunday)\n end", "def all_day\n beginning_of_day..end_of_day\n end", "def sundayCounter\n days = [31,28,31,30,31,30,31,31,30,31,30,31]\n date, sundays = 0, 1\n\n (1901...2000).each do\n (0..11).each do |month|\n date = (date + days[month]) % 7\n sundays += 1 if date == 6\n end\n end\n sundays\nend", "def work_day_employees\n all_week_employees = self.current_columns.each_slice(2).to_a\n\n return all_week_employees[Date.today.wday]\n end", "def weeks\n @weeks ||= days.slice_when do |day|\n Date::DAYNAMES[day.wday] == LAST_DAY_OF_THE_WEEK\n end.to_a\n end", "def is_day_number_a_sunday(number)\n # where 1 is '1 Jan 1900'\n # and 2 is '2 Jan 1900'\n return true if (number + 7) % 7 == 0\n return false\nend", "def each_saturday( n=1, offset=0, dur=1); each_wdays(self.Sat,n,offset,dur); end", "def holidays_with_bbqs(holiday_supplies)\n bbqs_array = []\n holiday_supplies.each do |season, holiday_hash| \n holiday_hash.each do |day, supplies| \n supplies.each do |supply| \n if supply == \"BBQ\"\n bbqs_array << day \n end\n end\n end\n end\nbbqs_array\nend", "def weekdays\n lines[1]\n end", "def getWdayForPublicHday(startDate)\n\t\tpHdays = getPublicHolidays()\n\t\twDayOfPublicHoliday = Array.new\n\t\tif !pHdays.blank?\t\t\n\t\t\tfor i in 0..6\n\t\t\t\twDayOfPublicHoliday << ((startDate+i).cwday).to_s if checkHoliday((startDate + i).to_s,pHdays)\n\t\t\tend\n\t\tend\t\n\t\twDayOfPublicHoliday\n\tend", "def not_scheduled_applications\n accepted_applications.select do |a|\n been_in_stage_for(a, 7.days.ago)\n end\n end", "def all_day\n beginning_of_day..end_of_day\n end", "def friday_numbers(arg)\n resp = []; i = 0; s = arg.size;\n\n while i < s do\n e = arg[i]\n\n if (Time.now.friday? && e < 0) || (!Time.now.friday? && e >= 0)\n resp << e\n end\n\n if true\n i+= 1\n end\n end\n\n return resp\n end", "def days_worked\n days = account.account_setting.working_days\n Hash[days.map { |k,v| [k, (v == \"1\")] }]\n end", "def schedule_days(day_ints = [1,3,5])\n (0..6).each {|day_int|\n is_checked = day_checked?(day_int)\n # puts \"is checked : #{is_checked}\"\n should_be_checked = day_ints.include?(day_int)\n # puts \"should_be_checked : #{should_be_checked}\"\n if (!is_checked && should_be_checked)\n click_day_picker(day_int)\n elsif (is_checked && !should_be_checked)\n click_day_picker(day_int)\n else\n\n end\n } \n current_scheduled_days\n end", "def all_working_days_of_month\n ending_of_month.downto(beginning_of_month).select(&:working_day?)\n end", "def index\n @sundays = Sunday.all\n end", "def week_date_ranges\n (1..ReportWeeks).map do |week|\n begin_date = @start_date + (7*(week-1))\n begin_date .. (begin_date + 6)\n end\n end", "def build_date_array(year, month)\n date_array = Array.new\n # cycle through days in month creating one key in the array for each day\n for d in (1..self.days_in_month(year, month))\n if d.to_i < 10 then\n # if date is 1-9 make sure it is 01-09\n d = \"0#{d}\"\n end\n date_array[d.to_i] = d\n end\n # remove 0 key for 1 to 1 mapping in array\n date_array.shift\n return date_array\n end", "def friday_numbers(numbers)\n is_friday? ? numbers.select { |number| number < 0 } : numbers.select { |number| number >= 0 }\n end", "def general\n @week == 0 ? true : false\n end", "def next_weeks_open_house_dates(open_house_dow)\n now = Time.now\n dates = []\n (0...7).each do |day_offset|\n days = day_offset*24*60*60\n date = now + days\n if open_house_dow.include?(date.wday)\n dates << now + days\n end\n end\n dates\n end", "def current_week_tasks\n @current_week_tasks = {monday:[], tuesday:[], wednesday:[], thursday: [], friday: [], saturday:[], sunday:[]}\n end", "def key_dates\n events = Array.new\n events << birth_event if !birth_event.nil?\n events << death_event if !death_event.nil?\n events.concat(marriage_events) if (!marriage_events.nil? and marriage_events.count > 0)\n events\n end", "def get_work_days\n puts \"Getting work days...\"\n work_days = []\n biweek = get_biweek\n week_1 = @schedule[biweek[0]].compact.uniq\n week_2 = @schedule[biweek[1]].compact.uniq\n\n @schedule.each_with_index do |row, i|\n DAYS.each_with_index do |day, j|\n date = ( i < biweek[1] ? week_1[j] : week_2[j] )\n day_name = day[:day]\n name = row[day[:name]]\n hours = row[day[:hours]]\n if name && hours && name.downcase.include?(@person.downcase)\n work_days.push({\n :name => @person,\n :date => get_date(date, hours)\n })\n end\n end\n end\n puts \"Work days:\\n#{work_days}\"\n return work_days\nend", "def days\n monday..sunday\n end", "def odd_week?; (to_i / 7.days).odd? end" ]
[ "0.71965784", "0.67568946", "0.6581913", "0.64520675", "0.63136214", "0.6308482", "0.6202394", "0.61984134", "0.6176048", "0.61348885", "0.6126456", "0.60864455", "0.6034387", "0.60218185", "0.59990925", "0.5979697", "0.59554625", "0.595433", "0.58854246", "0.5867371", "0.5842093", "0.5828503", "0.5817431", "0.5813009", "0.5788148", "0.57748306", "0.5774766", "0.57568485", "0.57308346", "0.57101655", "0.569848", "0.5686128", "0.5681714", "0.5670724", "0.5660646", "0.5660621", "0.5656984", "0.5623526", "0.5621678", "0.56188023", "0.559803", "0.55828923", "0.55805", "0.5576992", "0.5576109", "0.55713844", "0.5566095", "0.5525349", "0.55127424", "0.54952955", "0.54744893", "0.5456178", "0.5439155", "0.5436003", "0.5434503", "0.5434503", "0.54306245", "0.5417542", "0.54025143", "0.53828424", "0.5379569", "0.5374474", "0.5374128", "0.5353746", "0.53527015", "0.534825", "0.53396434", "0.53376764", "0.53314066", "0.53304344", "0.53286314", "0.53237873", "0.5312261", "0.52989686", "0.5291494", "0.52863866", "0.52851593", "0.52843654", "0.52801174", "0.5275507", "0.5273051", "0.5271595", "0.52702403", "0.52346295", "0.52324325", "0.5224468", "0.52242184", "0.5218483", "0.5217281", "0.5215408", "0.520753", "0.5204559", "0.51839536", "0.5183158", "0.5165335", "0.5146462", "0.5144685", "0.51446474", "0.51444286", "0.51443267" ]
0.69801205
1
Humanreadable string of applicable days of week
def days_of_week_string dow = days_of_week_hash @days_of_week_string ||= (dow[:sunday] ? "Su" : "") + (dow[:monday] ? "M" : "") + (dow[:tuesday] ? "Tu" : "") + (dow[:wednesday] ? "W" : "") + (dow[:thursday] ? "Th" : "") + (dow[:friday] ? "F" : "") + (dow[:saturday] ? "Sa" : "") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def day_name; Date::DAYNAMES[wday] end", "def week_days\n {\n \"1\" => 'mon',\n \"2\" => 'tue',\n \"3\" => 'wed',\n \"4\" => 'thu',\n \"5\" => 'fri',\n \"6\" => 'sat',\n \"7\" => 'sun'\n }\n end", "def wday_shortname date\n %w'вс пн вт ср чт пт сб'[date.wday]\n end", "def day_str(args = nil)\n ret = Datet.days(:trans => true)[self.day_in_week]\n if args and args[:short]\n ret = ret.slice(0, 3)\n end\n \n return ret\n end", "def day_in_week_str\n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(formatted(today))\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(formatted(Time.at(today.to_i - e*day_second)))\n\t\tend\n\n\t\tdays.sort\n\tend", "def weekday\n fail \"A value cannot be provided for #{__method__}\" if @value\n return 'Mon..Fri'\n end", "def weekday\n fail \"A value cannot be provided for #{__method__}\" if @value\n\n 'Mon..Fri'\n end", "def inspect\n \"#{year}-W#{week}-#{day}\"\n end", "def day_of_week\n start_on.strftime(WEEKDAY_NAME)\n end", "def days_of_week\n\n # create an array for processing\n days_array = [sunday, monday, tuesday, wednesday, thursday, friday, saturday]\n int_array = Array.new\n for day in days_array\n day ? int_array.push(1) : int_array.push(0)\n end\n\n # process with little recursive function\n r(int_array, 0)\n # fix first value, see note below\n int_array[0] == -1 ? int_array[0] = 1 : nil\n\n # final passes, change values into useable string\n int_array[0] == 1 ? int_array[0] = 'Su' : nil\n int_array[1] == 1 ? int_array[1] = 'M' : nil\n int_array[2] == 1 ? int_array[2] = 'Tu' : nil\n int_array[3] == 1 ? int_array[3] = 'W' : nil\n int_array[4] == 1 ? int_array[4] = 'Th' : nil\n int_array[5] == 1 ? int_array[5] = 'F' : nil\n int_array[6] == 1 ? int_array[6] = 'Sa' : nil\n\n int_array.delete(0)\n int_array.map{ |x| x == -1 ? '-' : x}.uniq.join\n\n end", "def name_of_day\n if day_of_week == -1\n DAY_NAMES[day_of_week]\n else\n DAY_NAMES[day_of_week - 1]\n end\n end", "def day_name\n return @@day_names[self.day_in_week]\n end", "def day_of_week\n\tif @current_time.wday == 0 || @current_time.wday == 6\n\t\tweek_period = \"Weekends\"\n\telse\n\t\tweek_period = \"Weekdays\"\n\tend\nend", "def abbr_day_name; Date::ABBR_DAYNAMES[wday] end", "def day_of_week\n dnum = day\n dnum -= 10 if dnum > 20\n dnum -= 10 if dnum > 10\n dnum -= 1\n dnum\n end", "def day_of_week\n # Zellers: 0 = Saturday, 1 = Sunday, 2 = Monday, ..., 6 = Friday\n # day_of_week: 1 = Sunday, 7 = Saturday\n (zellers_congruence + 6) % 7\n end", "def days_as_string\n day_string = ''\n day_map = %w[Sun Mon Tue Wed Thu Fri Sat]\n days.each { |d| day_string << day_map[d] + ', ' }\n day_string[0..(day_string.length - 3)]\n end", "def day_of_week\n Date::DAYNAMES.fetch(recurring_event.day).downcase.to_sym\n end", "def day_of_week(date)\n 7 - date.cwday\n end", "def day_week(date)\n day_week = \"--\"\n unless date.blank?\n case date.strftime(\"%A\")\n when \"Monday\"\n day_week = \"月\"\n when \"Tuesday\"\n day_week = \"火\"\n when \"Wednesday\"\n day_week = \"水\"\n when \"Thursday\"\n day_week = \"木\"\n when \"Friday\"\n day_week = \"金\"\n when \"Saturday\"\n day_week = \"土\"\n when \"Sunday\"\n day_week = \"日\"\n end\n else\n end\n return day_week\n end", "def day_of_week\n to_time.wday\n end", "def inspect\n \"it is the \" + ordinal_list(@weeks) + \" week of the month\"\n end", "def day_of_the_week(day)\n @dias = {1 => \"LUNES\", 2 => \"MARTES\", 3 => \"MIERCOLES\", 4 => \"JUEVES\", 5 => \"VIERNES\", 6 => \"SÁBADO\", 7 => \"DOMINGO\"}\n return @dias[day]\n end", "def get_day_name(day_of_the_week)\n\t\tcase day_of_the_week\n\t\t\twhen 0\n\t\t\t\t\"Sunday\"\n\t\t\twhen 1\n\t\t\t\t\"Monday\"\n\t\t\twhen 2\n\t\t\t\t\"Tuesday\"\n\t\t\twhen 3\n\t\t\t\t\"Wednesday\"\n\t\t\twhen 4\n\t\t\t\t\"Thursday\"\n\t\t\twhen 5\n\t\t\t\t\"Friday\"\n\t\t\twhen 6\n\t\t\t\t\"Saturday\"\n\t\t\telse\n\t\t\t\t\"It is not a day of the week!\"\n\t\tend\n\tend", "def wednesday\n day(:wednesday)\n end", "def w_day; end", "def day_of_the_week(time)\n Date::DAYNAMES[time.wday]\nend", "def week\n @obj.date.strftime(\"%V\")\n end", "def calendar_wdays(starting_day = 0)\n start_week = Date.today.beginning_of_week + (starting_day - 1).days # In rails week start in monday and monday.wday is 1\n (start_week...start_week+7.days).collect { |day| I18n.l(day, :format => '%A') }\n end", "def wday() end", "def day_of_week\n # Date.wday returns 0-6 for Sunday,...Saturday\n return @day.wday\n end", "def day_of_week\n randomize(Date::DAYNAMES)\n end", "def day_of_week\n randomize(Date::DAYNAMES)\n end", "def weekdays\n wdays = []\n wdays << 0 if sun\n wdays << 1 if mon\n wdays << 2 if tue\n wdays << 3 if wed\n wdays << 4 if thu\n wdays << 5 if fri\n wdays << 6 if sat\n\n wdays\n end", "def pretty_print\n days = []\n %w(monday tuesday wednesday thursday friday saturday sunday).each do |day|\n days << day.titleize if self.read_attribute(day)\n end\n days_join = days.empty? ? \"All days\" : days.join(', ')\n days_join = \"Weekdays\" if days_join == \"Monday, Tuesday, Wednesday, Thursday, Friday\"\n t = \"#{days_join} from #{start_time.to_formatted_s(:time12)} to #{end_time.to_formatted_s(:time12)}\"\n t << \" (choose your shift within these hours)\" if flexible?\n t\n rescue\n nil\n end", "def week\n published_at.strftime('%W')\n end", "def day_of_the_week(time)\n\tDate::DAYNAMES[time.wday]\nend", "def translate_day_of_week( day )\n days = { :Mon => \"Понедельник\", :Tue => \"Вторник\", :Wed => \"Среда\", :Thu => \"Четверг\",\n :Fri => \"Пятница\" }\n days[ day.to_sym ]\n end", "def heb_day_name\r\n return HEB_DAYS[@hd]\r\n end", "def show_weekdays( weekdays )\n weekdays.join( \" \" ) unless weekdays.length < 2\n end", "def weekdays\n value.each_char.map { |c| WEEKDAYS.index(c) }\n end", "def weeks() 7 * days end", "def week; end", "def days_past_in_week\n to_date.cwday\n end", "def weekdays\n lines[1]\n end", "def ymdnw\n nth = %w[1st 2nd 3rd 4th 5th][(mday + 6) / 7]\n wek = %w[Sun Mon Tue Wed Thu Fri Sat][wday]\n format(\"%04d-%02d-%02d %s %s\", year, month, mday, nth, wek)\n end", "def mweek; (5 - wday + day) / 7 end", "def wday\n to_g.wday\n end", "def thursday\n day(:thursday)\n end", "def _week_day_numbers\n week_day_start = self.week_day_start\n week_day_start.capitalize if week_day_start.is_a? String\n [0, 1, 2, 3, 4, 5, 6].partition {|on| on >= day_names.index(week_day_start)%7 }.flatten\n end", "def description\n I18n.t(\"date.abbr_day_names\")[wday] + I18n.l(start_time, :format => :only_time) + \"-\" + I18n.l(end_time, :format => :only_time)\n end", "def days_in_week(*days)\n @test_time = @time if @test_time.nil?\n x_in_list_of_y(@test_time.wday, Configuration.parse_range(days,0...7).flatten)\n end", "def day_to_wdiw( day )\n\t\tk = offset( first_day.cwday )\n\t\td = day + k - 1\n\t\tw = d / DPW\n\t\tdiw = d % DPW\n\n\t\t[ w, diw ]\n end", "def W; cat @time.strftime('%W') end", "def encode_by_day(days_of_week, offset = '')\n selected_days = days_of_week.map do |day|\n d = day.downcase.to_sym\n DAYS.include?(d) ? (offset + d.to_s) : nil\n end\n selected_days.compact.join(\",\")\n end", "def ymdw\n wek = %w[Sun Mon Tue Wed Thu Fri Sat][wday]\n format(\"%04d-%02d-%02d %s\", year, month, mday, wek)\n end", "def inspect\n \"the day of the month is the \" +\n ordinal_list(@days)\n end", "def week_result_string(day)\n start_of_week = day.beginning_of_week\n # adjust if the week started in a different month\n start = (day.month == start_of_week.month ? start_of_week.day - 1 : 0)\n end_of_week = day.end_of_week\n # adjust if the week finished in a different month\n finish = (day.month == end_of_week.month ? end_of_week.day - 1 : 30)\n month_result_string(day).slice(start..finish)\n end", "def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end", "def get_week_string\n team = @user.team\n start_of_week = Time.now.beginning_of_week(team.start_of_week_symbol)\n end_of_week = Time.now.end_of_week(team.start_of_week_symbol)\n\n start_string = start_of_week.strftime(\"%d %b %Y\")\n end_string = end_of_week.strftime(\"%d %b %Y\")\n\n start_string + \" - \" + end_string\n end", "def picker_weekday\n screenshot_and_raise \"weekday is not applicable to this mode\" if picker_is_in_time_mode or picker_is_in_countdown_mode\n res = query(\"datePickerWeekMonthDayView\", :weekdayLabel, :text)[2]\n # need to guard against Today showing\n res == nil ? Date.today.strftime('%a') : res\nend", "def days\n monday..sunday\n end", "def week\n self.date ? self.date.strftime('%Y-%W') : ('0000-00')\n end", "def w; cat @time.strftime('%w') end", "def wday\n components.weekday - 1\n end", "def start_of_week; self - wday.days end", "def week\n @date.cweek\n end", "def day_of_week\n return -1 if self.day_of_year == 308\n result = self.days_since_epoch % 8\n if result > 0\n result\n else\n 8\n end\n\n end", "def fmt_dow_dt(dt) _format_dt dt, DOW_DT end", "def fmt_dow_date(dt) _format_dt dt, DOW_M_D end", "def list_days\n\t\td = [\"Mondays,\", \"Tuesdays,\", \"Wednesdays,\", \"Thursdays,\", \"Fridays,\", \"Saturdays,\", \"Sundays,\"]\n\t\tx = []\n\n\t\tboolDays = get_days\n\n\t\tfor i in 0..d.length\n\t\t\tif boolDays[i] == true\n\t\t\t\tx << d[i]\n\t\t\tend\n\t\tend\n\t\tx.insert(x.length - 1, \"and\")\n\t\treturn (x*\" \").chop\n\tend", "def weekday\n current_time = Time.new\n current_time.strftime(\"%A\")\nend", "def weekday\n current_time = Time.new\n current_time.strftime(\"%A\")\nend", "def day_label(day, max_length: nil)\n full_name = DAYS[day]\n max_length ? full_name[0..(max_length - 1)] : full_name\n end", "def saturday\n day(:saturday)\n end", "def eval_date\n # FIXME: Make pref?\n h = Hash[\"mo\", 1, \"di\", 2, \"mi\", 3, \"do\", 4, \"fr\", 5, \"???\", 6]\n h.merge(Hash[\"mo\", 1, \"tu\", 2, \"we\", 3, \"th\", 4, \"fr\", 5, \"???\", 6])\n a = description.strip.downcase\n a = \"???\" if a.length < 3 || !h.include?(a[0..1])\n day = h[a[0..1]]\n time = a[2..a.length-1].strip.rjust(3, \"0\")\n \"#{day} #{time}\"\n end", "def set_days_of_week\n @days_of_week = Date::DAYNAMES.each_with_index\n end", "def day_of_week(date)\n date.cwday # cwday returns the day of calendar week (1-7, Monday is 1).\nend", "def test_it_can_convert_an_integer_day_of_week_to_the_word\n assert_equal \"Sunday\", FinderClass.day_of_week(0)\n assert_equal \"Monday\", FinderClass.day_of_week(1)\n assert_equal \"Tuesday\", FinderClass.day_of_week(2)\n assert_equal \"Wednesday\", FinderClass.day_of_week(3)\n assert_equal \"Thursday\", FinderClass.day_of_week(4)\n assert_equal \"Friday\", FinderClass.day_of_week(5)\n assert_equal \"Saturday\", FinderClass.day_of_week(6)\n end", "def end_of_week; self + (6 - wday).days end", "def start_week\n start_date.strftime('%W').to_i\n end", "def day_length day_timelimit\n case day_timelimit\n when 1\n return \"336 hours (2 weeks)\"\n when 2\n return \"168 hours (1 week)\"\n when 3\n return \"120 hours (5 days)\"\n when 4\n return \"72 hours (3 days)\"\n when 5\n return \"48 hours (2 days)\"\n when 6\n return \"24 hours (1 day)\"\n when 7\n return \"12 hours\"\n when 8\n return \"6 hours\"\n when 9\n return \"3 hours\"\n when 10\n return \"2 hours\"\n when 11\n return \"1 hour\"\n when 12\n return \"30 minutes\"\n when 13\n return \"15 minutes\"\n when 14\n return \"10 minutes\"\n when 15\n return \"5 minutes\"\n else\n return \"Error\"\n end\n end", "def what_day(string)\n if string.include?(\"L\")\n return \"Monday\"\n elsif string.include?(\"M\")\n return \"Tuesday\"\n elsif string.include?(\"I\")\n return \"Wednesday\"\n elsif string.include?(\"J\")\n return \"Thursday\"\n elsif string.include?(\"V\")\n return \"Friday\"\n elsif string.include?(\"S\")\n return \"Saturday\"\n elsif string.include?(\"D\")\n return \"Sunday\"\n end\n return \"NONE\"\n end", "def weekdays\n result = veeamconfig('schedule', 'show', '--jobId', get_job_id).lines\n\n if result[0].strip == 'Every day'\n ['daily']\n else\n result[0].strip.split(': ')[1].split(', ')\n end\n end", "def weeks\n rows = []\n rows << name_of_month.center(20) + \" \"\n rows << \"Su Mo Tu We Th Fr Sa\" + \" \"\n days = format_dates\n (0..7).each {|num|\n fields = days[num * 7, 7]\n rows << fields.join(\" \") + \" \" if fields\n }\n if rows.last.length < 22\n rows.last << \" \" * (22 - rows.last.length)\n end\n until rows.length == 8\n rows << \" \" * 22\n end\n rows\n end", "def dow(dt = nil)\n ::Date::ABBR_DAYNAMES[ to_datetime(dt).wday ].downcase.to_sym\n end", "def wday\n return self.to_a[IDX_WDAY]\n end", "def weekend\n [saturday, sunday]\n end", "def week(date = Date.today)\n day = monday(date)\n (day..day + 6)\n end", "def padding_for_calendar\n (fmwday == 0 ? (0..5) : (0...fmwday - 1)).map { '' }\n end", "def days\n return \"There are #{self * (24 * 60 * 60)} seconds in #{self} days\"\n end", "def day_in_week(args = nil)\n if args\n args.each do |key, val|\n case key\n when :mfirst\n else\n raise ArgumentError, \"Invalid key in arguments: '#{key}'.\"\n end\n end\n end\n \n #This is a monday - 0. Use this date to calculate up against.\n def_date = Datet.new(1970, 1, 4)\n \n if self > def_date\n days = Datet.days_between(def_date, self)\n factor = days.to_f / 7.0\n diw = days - (factor.floor * 7)\n else\n days = Datet.days_between(self, def_date)\n factor = days.to_f / 7.0\n diw = days - (factor.floor * 7)\n diw = 7 - diw\n diw = 0 if diw == 7\n end\n \n #Monday should be the first day in the week.\n if args and args[:mfirst]\n if diw == 0\n diw = 6\n else\n diw -= 1\n end\n end\n \n return diw\n end", "def nice_day string\r\n string = string.to_s\r\n return convert_day_to_date(string).strftime('%A, %B %e, %Y') if string.length == 8\r\n return Date.new(string).strftime('%A, %B %e, %Y')\r\n end", "def day_names\n self.class.day_names\n end", "def interval_string\n str = 'None'\n str = 'Weekly' if interval == 7 \n str = '2 Weeks' if interval == 14\n str = '3 Weeks' if interval == 21\n str = '4 weeks' if interval == 28\n str\n end", "def sunday\n day(:sunday)\n end", "def get_day_name(day) \n day_name = \"\"\n\n case day \n when \"Mon\"\n day_name = \"Monday\"\n when \"Tues\"\n day_name = \"Tuesday\"\n when \"Wed\"\n day_name = \"Wednesday\"\n when \"Thur\"\n day_name = \"Thursday\"\n when \"Fri\"\n day_name = \"Friday\"\n when \"Sat\"\n day_name = \"Saturday\"\n when \"Sun\"\n day_name = \"Sunday\"\n else\n day_name = \"Invalid abbreviation\"\n end \n\n return day_name\nend", "def to_s\n mday.to_s\n end", "def day_str(timezone = patient.timezone)\n parsed_time(timezone).strftime(\"%A\")\n end", "def utc_day_str\n self.datetime.strftime(\"%A\")\n end" ]
[ "0.7737139", "0.7486552", "0.7469496", "0.73546207", "0.72907776", "0.7284998", "0.7241393", "0.72357625", "0.71897435", "0.7145447", "0.7094004", "0.70383483", "0.7018797", "0.6955864", "0.69220936", "0.69005585", "0.6775498", "0.67750865", "0.67712194", "0.6764459", "0.6739988", "0.66903776", "0.6685999", "0.6672498", "0.6653683", "0.6650071", "0.6632887", "0.6628926", "0.66160697", "0.66067094", "0.65998566", "0.65973127", "0.65973127", "0.658997", "0.6587552", "0.65822744", "0.65580773", "0.6505193", "0.6491676", "0.6477754", "0.6475371", "0.6443957", "0.6438164", "0.64325637", "0.6430756", "0.64190054", "0.640731", "0.6398813", "0.63717055", "0.63456345", "0.6340497", "0.63244313", "0.6320835", "0.6318757", "0.62596303", "0.6258086", "0.62524146", "0.6247269", "0.623003", "0.62276083", "0.6205001", "0.61998343", "0.61891043", "0.6166837", "0.6158453", "0.61536425", "0.6136228", "0.6135904", "0.6135871", "0.61347336", "0.6133538", "0.61232084", "0.610581", "0.61004066", "0.6098154", "0.6095061", "0.6084608", "0.60825425", "0.60724396", "0.6050428", "0.6038935", "0.60317326", "0.6027711", "0.6023", "0.60217386", "0.6014784", "0.60127616", "0.6012213", "0.5983021", "0.597725", "0.5973841", "0.5940324", "0.5925354", "0.5923325", "0.5922686", "0.59225655", "0.5921205", "0.59016424", "0.588179", "0.5880459" ]
0.78225845
0
End days_of_week Helpers Returns the next full occurrence of these operating time rule. If we are currently within a valid time range, it will look forward for the next opening time
def next_times(at = Time.now) at = at.midnight unless at.respond_to? :offset return nil if length == 0 return nil if at.to_date > endDate # Schedules end at 23:59 of the stored endDate at = startDate.midnight if at < startDate # This schedule hasn't started yet, skip to startDate # Next occurrence is later today # This is the only time the "time" actually matters; # after today, all we care about is the date if days_of_week_array[at.wday] and start >= at.offset open = at.midnight + start close = open + length return [open,close] end # We don't care about the time offset anymore, jump to the next midnight at = at.midnight + 1.day # NOTE This also has the added benefit of preventing an infinite loop # from occurring if +at+ gets shifted by 0.days further down. # Shift days_of_weekArray so that +at+ is first element dow = days_of_week_array[at.wday..-1] + days_of_week_array[0..(at.wday-1)] # NOTE The above call does something a little quirky: # In the event that at.wday = 0, it concatenates the array with itself. # Since we are only interested in the first true value, this does not # cause a problem, but could probably be cleaned up if done so carefully. # Next day of the week this schedule is valid for (relative to current day) shift = dow.index(true) if shift # Skip forward at = at + shift.days else # Give up, there are no more occurrences # TODO Test edge case: valid for 1 day/week return nil end # Recurse to rerun the validation routines return next_times(at) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def end_of_week\n @end_of_week ||= (start_of_week + 6)\n end", "def end_of_week(start_day = Date.beginning_of_week)\n last_hour(days_since(6 - days_to_week_start(start_day)))\n end", "def end_of_week; self + (6 - wday).days end", "def ending_of_week\n if current_week.index(day) == 6\n self.class.new(year, month, current_week.last)\n elsif current_week.index(day) < 6\n if self.class == Date\n self + (6 - current_week.index(day))\n elsif self.class == Time\n self + (60 * 60 * 24 * (6 - current_week.index(day)))\n end\n end\n end", "def end_of_week\n if current_week.index(self.day) == 6\n self.class.new(year,month,current_week.last)\n elsif current_week.index(self.day) < 6\n if self.class == Date\n self + (6 - current_week.index(self.day))\n elsif self.class == Time\n self + (60 * 60 * 24 * (6 - current_week.index(self.day)))\n end\n end\n end", "def end_of_week\n 6.days.from_now(beginning_of_week).end_of_day\n end", "def get_next_date\n today_wday = Date.today.wday\n wday_s = get_weekday(limit_weekday_start)\n wday_e = get_weekday(limit_weekday_end)\n if(wday_s < wday_e)\n if(today_wday > wday_e or today_wday < wday_s or(today_wday == wday_s and Time.now.hour < limit_time_start) or (today_wday == wday_e and Time.now.hour > limit_time_end))\n need_day = (wday_s + 7 - today_wday)%7\n return Time.parse(limit_time_start.to_s + \":00\", Time.now + need_day.day), true\n else\n need_day = wday_e - today_wday\n return Time.parse(limit_time_end.to_s + \":00\", Time.now + need_day.day), false\n end\n else\n if((wday_e < today_wday and today_wday < wday_s) or (today_wday == wday_s and Time.now.hour < limit_time_start) or (today_wday == wday_e and Time.now.hour > limit_time_end))\n need_day = wday_s - today_wday\n return Time.parse(limit_time_start.to_s + \":00\", Time.now + need_day.day), true\n else\n need_day = (wday_e + 7 - today_wday)%7\n return Time.parse(limit_time_end.to_s + \":00\", Time.now + need_day.day), false\n end\n end\n end", "def end_of_week\n (beginning_of_week+6).end_of_day\n end", "def end_of_day(date_time)\n unless working_day?(date_time)\n return end_of_day(previous_working_day(date_time))\n end\n work_time = to_work_time(date_time)\n work_day = to_work_day(date_time)\n if work_time < work_day.start_time\n return end_of_day(previous_working_day(to_modified_date_time(date_time, WorkTime.new(12, 0))))\n end\n return to_modified_date_time(date_time, work_day.end_time)\n end", "def work_day_ends_at(options={})\n be_precise = options[:precise]\n\n if(be_precise)\n hours_worked, interval_ended_at = total_hours_worked({estimate: true, estimate_ended_at: true})\n hours_delta = WorkInterval.round_by((8 - hours_worked).hours)\n\n (interval_ended_at + hours_delta.hours)\n \n else\n rounded_work_day_ends_at(options)\n end\n end", "def weekend?\n wday == 0 || wday == 6\n end", "def date_end # originally date_start\n\tdate = Date.today\n\t(1..7).each do |n|\n\t\tdate = Date.today - n#.days\n\t\tbreak if date.wday == 6 # 0 = Sun, 1 = Mon ... 6 = Sat\n\tend\n\tdate\nend", "def end_date\n Date.new((@number + 1), 1, 1).tuesday? ? Date.new((@number + 1), 1, 1) : Date.new(@number, 12, 31)\n end", "def time_or_end_of_day(date_time)\n wt = to_work_time(date_time)\n work_day = get_work_day(date_time)\n if wt > work_day.end_time\n return end_of_day(date_time)\n elsif wt < work_day.start_time\n return start_of_day(date_time)\n else\n return date_time\n end\n end", "def effective_end_datetime\n end_date + 1.day + roster.switchover.minutes\n end", "def end_week\n end_date.strftime('%W').to_i\n end", "def week_end?\n saturday? || sunday?\n end", "def weekend\n [saturday, sunday]\n end", "def ends\n ends = nil\n @doc.find(\"/dwml/data/time-layout/end-valid-time/text()\").map do |node|\n t = Time.parse(node.to_s)\n ends = t if !ends || t > ends\n end\n @ends = ends\n end", "def end_of_day\n to_time.end_of_day\n end", "def end_of_day\n change(\n hour: 23,\n min: 59,\n sec: 59,\n usec: Rational(999999999, 1000)\n )\n end", "def workdays_in_range\n end_time ? (start_time.to_date..end_time.to_date).select { |d| (1..5).cover?(d.wday) }.size - offset : 1\n end", "def end_time_on_date(date)\n # puts \"end_time_on_date:\"\n # puts \"date.beginning_of_day: #{date.beginning_of_day}\"\n # puts \"start_time: #{start_time}\"\n # puts \"(date + 1).beginning_of_day: #{(date + 1).beginning_of_day}\"\n # puts \"end_time: #{end_time}\"\n if end_time.nil?\n start_time_on_date(date)\n elsif date.beginning_of_day < end_time &&\n end_time <= (date + 1).beginning_of_day\n # puts \"returning end time: #{end_time}\"\n end_time\n elsif (date + 1).beginning_of_day < end_time &&\n start_time < (date + 1).beginning_of_day\n # puts \"returning end of date: #{(date + 1).beginning_of_day}\"\n (date + 1).beginning_of_day\n else\n raise ArgumentError\n end\n end", "def end_of_week(year, month, week)\n date_calc.end_of_week(year, month, week)\n end", "def end_date\n weekday = end_of_month.cwday\n offset = weekday == 7 ? 0 : (7 - weekday).days\n end_of_month + offset\n end", "def end_date\n (Time.parse(@end_date).in_time_zone(@timezone).to_datetime if @end_date) || Date.today + 7.days\n end", "def end_hour_with_respecting_end_of_day\n if end_minute_without_respecting_end_of_day >= 59 and end_hour_without_respecting_end_of_day == 23\n 24\n else\n end_hour_without_respecting_end_of_day\n end\n end", "def end_time\n\t\tstart + 1.day\n\tend", "def weekend?\n [0, 6].include?(date.wday)\n end", "def on_weekend?\n wday.in?(WEEKEND_DAYS)\n end", "def on_weekend?\n WEEKEND_DAYS.include?(wday)\n end", "def working_day?\n !week_end?\n end", "def timer_ends_at\n # During task initialization, this is called by TimeableTask to schedule the TaskTimer.\n return @end_date if @end_date\n\n # Check for last existing associated TaskTimer\n task_timer = TaskTimer.where(task: self).order(:id).last\n return task_timer.submitted_at if task_timer\n\n # from_date should be appeal receipt date if the appeal is in the ESW docket\n from_date = appeal.receipt_date if appeal.evidence_submission_docket?\n\n # ...or from_date should be the date the hearing was scheduled if a hearing is present\n from_date ||= hearing.hearing_day&.scheduled_for if hearing.present?\n\n # ...or if no hearing is present, from_date should end when the hearing task was cancelled\n from_date ||= cancelled_schedule_hearing_task&.closed_at\n\n # if from_date is still nil, fall back to when this task was created\n from_date = ensure_from_date_set(from_date)\n\n # Add 90 days to the timer based on the date above\n from_date + 90.days\n end", "def after_last_work(start)\n if @values[start.wday].last_hour.nil?\n return start.next_day\n else \n start = start + HOUR * (@values[start.wday].last_hour - start.hour)\n start = start + MINUTE * (@values[start.wday].last_min - start.min + 1)\n return start\n end \n end", "def end_date\n (created_at - 1.week).sunday - 1.day\n end", "def next_meeting(after_time = Time.now.utc )\n # puts \"Looking up next meeting after #{after_time}\"\n if recurrence_frequency.blank?\n return start_time\n end\n\n if after_time < start_time\n return start_time\n end \n\n after_time = after_time.local_from_utc(self.time_zone) \n\n\n # Advance the starting time in the case when it falls after the beginning of\n # a meeting on the same day. We do this so that we can use \"day precision\"\n # (PDate.day) in the Runt library instead of \"minute precision\" (PDate.min),\n # which performs terribly.\n start_time = start_time_local\n if(after_time.hour > start_time.hour or ( after_time.hour == start_time.hour and after_time.min > start_time.min))\n after_time = after_time + 1.day\n after_time = Time.gm(after_time.year, after_time.month, after_time.day, 0, 0)\n end\n\n case recurrence_frequency\n when 'daily'\n end_time = after_time + 25.hours \n # after_time -= 1.day\n start_date = PDate.day(after_time.year, after_time.month, after_time.day , after_time.hour, after_time.min)\n end_date = PDate.day(end_time.year, end_time.month, end_time.day, end_time.hour, end_time.min)\n when 'weekdays'\n # Make the range over 3 days so that Friday night searches will still turn\n # up Monday as the next day.\n end_time = after_time + 3.days\n start_date = PDate.day(after_time.year, after_time.month, after_time.day, after_time.hour, after_time.min)\n end_date = PDate.day(end_time.year, end_time.month, end_time.day, end_time.hour, end_time.min)\n when 'monthly'\n eom = (after_time + 40.days)\n start_date = PDate.day(after_time.year, after_time.month, after_time.day)\n end_date = PDate.day(eom.year, eom.month, eom.day)\n when 'weekly'\n eow = (after_time + 8.days)\n start_date = PDate.day(after_time.year, after_time.month, after_time.day)\n end_date = PDate.day(eow.year, eow.month, eow.day)\n when 'yearly'\n # Just doing \"after_time + 367.days\" results in a bit of a performance hit\n # as hundreds of days are compared. We'll try to narrow it a bit. Not too\n # much, because we don't have time to actually write unit tests and make\n # sure the narrowing code works. :) Which is why the comment is here.\n st = after_time + 250.days\n et = st + 150.days\n start_date = PDate.day(st.year, st.month, st.day)\n end_date = PDate.day(et.year, et.month, et.day)\n end \n # puts \" Range #{start_date.to_s} - #{end_date.to_s}\"\n d_range = DateRange.new(start_date, end_date)\n sched = Schedule.new\n event = Event.new((self.invitation.name rescue \"no name\"))\n sched.add(event,self.runt_expression)\n dates = sched.dates(event,d_range)\n\n next_mtg = dates.first\n next_mtg_time = Time.gm(next_mtg.year, next_mtg.month, next_mtg.day, start_time_local.hour, start_time_local.min)\n result = nil\n begin\n result = next_mtg_time.local_to_utc(self.time_zone)\n rescue TZInfo::PeriodNotFound\n # This only happens when the time is during the one hour which is skipped\n # during the transition to DST. For example, only on Sun Mar 08 02:15:00\n # (see ticket #744).\n next_hour = start_time_local.hour + 1\n next_mtg_time = Time.gm(next_mtg.year, next_mtg.month, next_mtg.day, next_hour, start_time_local.min)\n retry\n end\n return result\n end", "def day_end\n\t\tself.at_beginning_of_day + 86399.999999\n\tend", "def end_of_day\n change(:hour => 23, :min => 59, :sec => 59, :usec => 999999.999)\n end", "def time_is_within_scheduled_days\n \tif start_time\n \t\tschedule = Schedule.find_by(id: Piece.find_by(id: piece_id).schedule_id)\n\t update_day = nil\n\t schedule.days.each do |day|\n\t \t\tupdate_day = day if start_time >= day.start_time and start_time <= day.end_time\n\t \t\tbreak if !update_day.nil?\n\t end\n\t update_day.nil? ? errors.add(:start_time, \"must be during one of the scheduled times\") : update_attribute(:day, update_day)\n\t else\n\t \tupdate_attribute(:day, nil)\n\t end\n end", "def time_days() (@time_end.jd - @time_start.jd) + 1; end", "def check_end_time\n return unless self.end_time?\n calculate_total_time unless self.total_time?\n end", "def shift_end_hour\n if self.start_time.hour >= 0 && self.start_time.hour <= 2 && self.end_time.hour > 2 \n errors.add(:end_time, 'must be between 7am and 3am')\n end\n if self.end_time.hour > 2 && self.end_time.hour < 7\n errors.add(:end_time, 'must be between 7am and 3am')\n end \n end", "def find_next_week\n if @schedule.days == 0\n date = @date + ((@schedule.start_date.wday - @date.wday) % 7) + (7 * ((@schedule.start_date - @date) % @schedule.period_num))\n return date\n else\n date = @date + find_next_in_bitmask(@schedule.days, @date.wday, 7)\n\n if @date.wday >= bitmask(@schedule.days).length\n date += periods_to_add * 7\n end\n\n return date\n end\n end", "def beginning_of_week; end", "def beginning_of_week; end", "def next_weekday\n if next_day.on_weekend?\n next_week(:monday, same_time: true)\n else\n next_day\n end\n end", "def next_weekday\n if next_day.on_weekend?\n next_week(:monday, same_time: true)\n else\n next_day\n end\n end", "def local_end_of_day\n t = @time.getlocal\n t = Time.new(t.year, t.month, t.day, 23, 59, 59.999)\n VoltTime.from_time(t)\n end", "def next_opens\n opening_time.advance(weeks: 1)\n end", "def potential_working_days(start_date, end_date)\n days_worked = (start_date..end_date).select do |day|\n day = day.strftime(\"%A\").downcase.to_sym\n works_on?(day)\n end\n days_worked.count\n end", "def end_of_day_in_seconds\n @end_of_day_in_seconds ||= begin\n seconds_from_time(end_time).tap do |end_of_day_in_seconds|\n unless end_of_day_in_seconds > start_time_in_seconds\n raise(ConfigError, \"END_TIME must be after START_TIME\")\n end\n end\n end\n end", "def getDayOffCount\n\t\tdayCount = 0\n\t\tunless Setting.plugin_redmine_wktime['wk_schedule_weekend'].blank?\n\t\t\tdayCount = Setting.plugin_redmine_wktime['wk_schedule_weekend'].length\n\t\tend\n\t\tdayCount\n\tend", "def end_of_day\n VoltTime.new(:utc, year, month, day, 23, 59, 59.999)\n end", "def business_hours_later( hours)\n now = Time.now # freeze it here for this cycle of call, or it keeps changing every second\n wanted = (hours.to_i.hours / 1.second) # convert hours to seconds\n available = available_work_seconds( now) # how much available today\n # if we have enough time today, just tell the time possible today\n # if we will run out of time today, check next working day, add run-over seconds to the start-of-day\n (available > wanted) ? ( now + wanted.seconds) : ( next_workday(now) + (wanted - available).seconds)\n end", "def test_week_end_of_week_sat\n assert_result_date :week, \"2013-03-16\", \"2013-03-22 23:59:59\", false, week_start: :sat\n end", "def by_weekend(time=Time.now, options = {}, &block)\n time = parse(time)\n start_time = time.beginning_of_weekend\n end_time = (start_time + 1.day).end_of_day\n by_star(start_time, end_time, options, &block)\n end", "def day_of_week\n\tif @current_time.wday == 0 || @current_time.wday == 6\n\t\tweek_period = \"Weekends\"\n\telse\n\t\tweek_period = \"Weekdays\"\n\tend\nend", "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end", "def end_date\n return (start and duration_days and duration_hours) ? (start + duration_days.days + duration_hours.hours) : nil\n end", "def end_of_monitoring_period?\n return false if continuous_exposure\n\n monitoring_period_days = ADMIN_OPTIONS['monitoring_period_days'].days\n\n # If there is a last date of exposure - base monitoring period off of that date\n monitoring_end_date = if !last_date_of_exposure.nil?\n last_date_of_exposure.beginning_of_day + monitoring_period_days\n else\n # Otherwise, if there is no last date of exposure - base monitoring period off of creation date\n created_at.beginning_of_day + monitoring_period_days\n end\n\n # If it is the last day of or past the monitoring period\n # NOTE: beginning_of_day is used as monitoring period is based of date not the specific time\n curr_date_in_timezone.beginning_of_day >= monitoring_end_date\n end", "def weekend_day_number?(day_number)\n @weekend.include?(day_number)\n end", "def test_is_a_weekend?(p_date = Date.today)\n p_date.saturday? || p_date.sunday?\n end", "def run_end_time\n end_times =\n @data['controls'].map do |control|\n control['results'].map { |result| end_time(result['start_time'], result['run_time']) }\n end\n\n end_times.flatten.max\n end", "def addDayOfWeekSpecification(time, dows)\n\t\tcurrentDow = time.wday\n\t\tnextDow = nil\n\t\tdows.each { |d|\n\t\t\tif d < currentDow\n\t\t\t\tdd = d + 7\n\t\t\telse\n\t\t\t\tdd = d\n\t\t\tend\n\t\t\tif nextDow.nil? or (dd < nextDow)\n\t\t\t\tnextDow = dd\n\t\t\tend\n\t\t}\n\t\tif nextDow\n\t\t\treturn time + (nextDow - currentDow) * 24 * 60 * 60\n\t\tend\n\t\treturn time\n\tend", "def working_days_until(other)\n return -other.working_days_until(self) if other < self\n\n whole_days_to(other).count do |day|\n day.weekday? && !day.public_holiday?\n end\n end", "def estimated_end_date\n Date.today + remaining_days\n end", "def sunday\n end_of_week(:monday)\n end", "def week_end(week_num, year = 0)\n year = Time.now.year if year == 0\n \n begin\n last_date_of_the_week = Date.commercial(year, week_num, 7)\n \n # same idea with week_start but we'll increment the year\n rescue\n year -= 1\n last_date_of_the_week = Date.commercial(year, week_num, 7)\n end\n \n last_date_of_the_week = Date.commercial(year, week_num, 7)\n \n last_date_of_the_week\n end", "def weekend_and_holiday(day)\n holiday = Holidays.on(day, :federal_reserve, :observed).any?\n weekend = day.saturday? || day.sunday?\n [weekend, holiday]\n end", "def last_calendar_day\n @date.end_of_month.end_of_week(:sunday)\n end", "def advance_by_a_day\n scheduler = Scheduler.new(tasks, user_preferences)\n tasks_and_time = scheduler.call\n\n advanced_tasks = tasks_and_time.map do |task, time_to_advance|\n task.running_calculation ||= task.completed_hours\n task.running_calculation += time_to_advance\n task\n end\n\n @tasks = advanced_tasks.reject do |task|\n task.running_calculation >= task.estimated_hours\n end + tasks.reject do |task|\n advanced_tasks.map(&:id).include? task.id\n end\n\n tasks_and_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def downtime(start_time, end_time)\n outs = outages(start_time, end_time)[:outages]\n\n total_secs = {}\n percentages = {}\n\n outs.collect {|obj| obj.condition}.uniq.each do |st|\n total_secs[st] = 0\n percentages[st] = (start_time.nil? || end_time.nil?) ? nil : 0\n end\n\n unless outs.empty?\n\n # Initially we need to check for cases where a scheduled\n # maintenance period is fully covered by an outage period.\n # We then create two new outage periods to cover the time around\n # the scheduled maintenance period, and remove the original.\n\n delete_outs = []\n sched_maintenances = scheduled_maintenances(start_time, end_time)[:scheduled_maintenances]\n\n sched_maintenances.each do |sm|\n\n split_outs = []\n\n outs.each { |o|\n next unless o.end_time && (o.start_time < sm.start_time) &&\n (o.end_time > sm.end_time)\n delete_outs << o\n\n out_split_start = Outage.new\n out_split_start.condition = o.condition\n out_split_start.start_time = o.start_time\n out_split_start.end_time = sm.start_time\n out_split_start.duration = sm.start_time - o.start_time\n out_split_start.summary = \"#{o.summary} [split start]\"\n\n out_split_end = Outage.new\n out_split_end.condition = o.condition\n out_split_end.start_time = sm.end_time\n out_split_end.end_time = o.end_time\n out_split_end.duration = o.end_time - sm.end_time\n out_split_end.summary = \"#{o.summary} [split finish]\"\n\n split_outs += [out_split_start, out_split_end]\n }\n\n outs -= delete_outs\n outs += split_outs\n # not strictly necessary to keep the data sorted, but\n # will make more sense when debgging\n outs.sort! {|a,b| a.start_time <=> b.start_time}\n end\n\n delete_outs.clear\n\n sched_maintenances.each do |sm|\n\n outs.each do |o|\n next unless o.end_time && (sm.start_time < o.end_time) &&\n (sm.end_time > o.start_time)\n\n if sm.start_time <= o.start_time &&\n sm.end_time >= o.end_time\n\n # outage is fully overlapped by the scheduled maintenance\n delete_outs << o\n\n elsif sm.start_time <= o.start_time\n # partially overlapping on the earlier side\n o.start_time = sm.end_time\n o.duration = o.end_time - o.start_time\n elsif sm.end_time >= o.end_time\n # partially overlapping on the later side\n o.end_time = sm.start_time\n o.duration = o.end_time - o.start_time\n end\n end\n\n outs -= delete_outs\n end\n\n total_secs = outs.inject(total_secs) {|ret, o|\n ret[o.condition] += o.duration if o.duration\n ret\n }\n\n unless (start_time.nil? || end_time.nil?)\n total_secs.each_pair do |st, ts|\n percentages[st] = (total_secs[st] * 100.0) / (end_time.to_f - start_time.to_f)\n end\n total_secs['ok'] = (end_time - start_time) - total_secs.values.reduce(:+)\n percentages['ok'] = 100 - percentages.values.reduce(:+)\n end\n end\n\n {:total_seconds => total_secs, :percentages => percentages, :downtime => outs}\n end", "def opening_time\n Time.current.beginning_of_week(:sunday)\n end", "def getDayOffs(userIdsArr, from, to, lastDayOff)\n\t\tdayOffCount = getDayOffCount\n\t\tdayOffHash = Hash.new\n\t\t# period = \"W\"\n\t\t# isConsecutive = true\n\t\t# userLastDayOff = lastDayOff.select { |userId, dayOff| userIdsArr.include? userId }\n\t\t# sortedUserLastDayOff = lastDayOff.sort_by { |uid, schDt| schDt || Date.new(1900) }\n\t\tnoOfUsers = userIdsArr.length\n\t\tnoOfDays = getDaysBetween(from, to)#(to - from).to_i + 1 \n\t\tminWorkersPerDay = (noOfUsers * (noOfDays - dayOffCount)) / noOfDays\n\t\t# minLeaveUsrPerDay = (noOfUsers * dayOffCount) / 7\n\t\t# maxLeaveUsrPerDay = minLeaveUsrPerDay + 1\n\t\tmaxLeaveUsrPerDay = noOfUsers - minWorkersPerDay\n\t\t# noOfDaysHasMaxLeave = (noOfUsers * dayOffCount) % 7\n\t\t# nextDate = from\n\t\t# interval = 1\n\t\t# scheduleOnWeekEnds = false\n\t\t# if Setting.plugin_redmine_wktime['wk_schedule_on_weekend'].to_i == 1\n\t\t\t# scheduleOnWeekEnds = true\n\t\t# end\n\t\tweekEndArr = getWeekEndArr(from) \n\t\tdofUserAllocateHash = Hash.new\n\t\tremaingDOHash = Hash.new\n\t\tif scheduleByPreference && isScheduleOnWeekEnd && dayOffCount>0\n\t\t\tuserPreference = getUserPreferenceDO(userIdsArr, from, to)\n\t\t\t\n\t\t\t# Allocate the prefered users dayoffs \n\t\t\tfrom.upto(to) do |offDt|\n\t\t\t\tuserIds = userPreference[offDt]\n\t\t\t\tunless userIds.blank?\n\t\t\t\t\tuserIds.each do|userId|\n\t\t\t\t\t\tif dayOffHash[userId].blank? || dayOffHash[userId].length < dayOffCount\n\t\t\t\t\t\t\tdofUserAllocateHash[offDt] = dofUserAllocateHash[offDt].blank? ? [userId] : dofUserAllocateHash[offDt] + [offDt]\n\t\t\t\t\t\t\tdayOffHash[userId] = dayOffHash[userId].blank? ? [offDt] : dayOffHash[userId] + [offDt]\n\t\t\t\t\t\tend\n\t\t\t\t\t\tbreak if !dofUserAllocateHash[offDt].blank? && dofUserAllocateHash[offDt].length == maxLeaveUsrPerDay\n\t\t\t\t\tend\n\t\t\t\t\tallocatedDayOff = dofUserAllocateHash[offDt].blank? ? 0 : dofUserAllocateHash[offDt].length\n\t\t\t\t\tremaingDOHash[offDt] = maxLeaveUsrPerDay - allocatedDayOff\n\t\t\t\telse\n\t\t\t\t\tremaingDOHash[offDt] = maxLeaveUsrPerDay\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\t# Allocate Dayoffs for those who are dont have any preference\n\t\t\tuserIdsArr.each_with_index do |userId, index|\n\t\t\t\tif dayOffHash[userId].blank? || dayOffHash[userId].length < dayOffCount\n\t\t\t\t\tfrom.upto(to) do |offDt|\n\t\t\t\t\t\tif dofUserAllocateHash[offDt].blank? || dofUserAllocateHash[offDt].length < maxLeaveUsrPerDay\n\t\t\t\t\t\t\tdofUserAllocateHash[offDt] = dofUserAllocateHash[offDt].blank? ? [userId] : dofUserAllocateHash[offDt] + [offDt]\n\t\t\t\t\t\t\tdayOffHash[userId] = dayOffHash[userId].blank? ? [offDt] : dayOffHash[userId] + [offDt]\n\t\t\t\t\t\tend\n\t\t\t\t\t\tbreak if !dayOffHash[userId].blank? && dayOffHash[userId].length == dayOffCount\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\t# This Section need to modify. \n\t\t\t# Scenerio: 'Staff A' has 2 days leave but there is one day only available with maxLeaveUsrPerDay\n\t\t\t# So you cound not assign 2 days to that user.\n\t\t\t# Currently we have assign some other day as leave to 'Staff A'\n\t\t\t# It leads to lack required staff on that day\n\t\t\t# You need to rearrange the dayOffs to solve this \n\t\t\tunscheduleUserCnt = 0\n\t\t\tuserIdsArr.each_with_index do |userId, index|\n\t\t\t\tif dayOffHash[userId].blank? || dayOffHash[userId].length < dayOffCount\n\t\t\t\t\tgivenOff = dayOffHash[userId].blank? ? 0 : dayOffHash[userId].length\n\t\t\t\t\tfor dof in 0..dayOffCount-1-givenOff\n\t\t\t\t\t\toffDt = from + (((unscheduleUserCnt * dayOffCount) + dof) % noOfDays).days\n\t\t\t\t\t\tunless givenOff == 0\n\t\t\t\t\t\t\tuntil !dayOffHash[userId].include? offDt\n\t\t\t\t\t\t\t\tunscheduleUserCnt = unscheduleUserCnt + 1\n\t\t\t\t\t\t\t\toffDt = from + (((unscheduleUserCnt * dayOffCount) + dof) % noOfDays).days\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend \n\t\t\t\t\t\tdofUserAllocateHash[offDt] = dofUserAllocateHash[offDt].blank? ? [userId] : dofUserAllocateHash[offDt] + [offDt]\n\t\t\t\t\t\tdayOffHash[userId] = dayOffHash[userId].blank? ? [offDt] : dayOffHash[userId] + [offDt]\n\t\t\t\t\tend\n\t\t\t\t\tunscheduleUserCnt = unscheduleUserCnt + 1\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tuserIdsArr.each_with_index do |userId, index|\n\t\t\t\tdayOffArr = Array.new\n\t\t\t\t#firstLeaveDt = from + ((index * dayOffCount) % noOfDays).days\n\t\t\t\tif isScheduleOnWeekEnd\n\t\t\t\t\tfor dof in 0..dayOffCount-1\n\t\t\t\t\t\t# This calculation will give the next day of last given dayoff\n\t\t\t\t\t\tdayOffArr << from + (((index * dayOffCount) + dof) % noOfDays).days\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tdayOffArr = weekEndArr\n\t\t\t\tend\n\t\t\t\tdayOffHash[userId] = dayOffArr\n\t\t\tend\n\t\tend\n\t\tdayOffHash\n\tend", "def all_non_week_days_of_month\n ending_of_month.downto(beginning_of_month).select(&:week_end?)\n end", "def night_length night_timelimit\n case day_timelimit\n when 1\n return \"336 hours (2 weeks)\"\n when 2\n return \"168 hours (1 week)\"\n when 3\n return \"120 hours (5 days)\"\n when 4\n return \"72 hours (3 days)\"\n when 5\n return \"48 hours (2 days)\"\n when 6\n return \"24 hours (1 day)\"\n when 7\n return \"12 hours\"\n when 8\n return \"6 hours\"\n when 9\n return \"3 hours\"\n when 10\n return \"2 hours\"\n when 11\n return \"1 hour\"\n when 12\n return \"30 minutes\"\n when 13\n return \"15 minutes\"\n when 14\n return \"10 minutes\"\n when 15\n return \"5 minutes\"\n else\n return \"Error\"\n end\n end", "def working_days_after(start_date, num_working_days)\n start_date = to_date(start_date)\n populate_public_holiday_collection_for_year(start_date.year)\n working_days_offset(start_date, num_working_days, :forward)\n end", "def rule_filter\n x = @game_time_ps_avail.reject { |_k, v| v.empty? }\n return unless x.empty?\n\n if @cur_rule_index < @rules.size - 1\n last_rule = @cur_rule\n @cur_rule_index += 1\n @cur_rule = @rules[@cur_rule_index]\n # Go to the next date (except if the new rule is for the same weekday)\n @cur_date = next_game_date(@cur_date += 1, @cur_rule.wday) if last_rule.wday != @cur_rule.wday\n else\n @cur_rule_index = 0\n @cur_rule = @rules[@cur_rule_index]\n @cur_date = next_game_date(@cur_date += 1, @cur_rule.wday)\n end\n reset_resource_availability\n end", "def rule_filter\n x = @game_time_ps_avail.reject{|k,v| v.empty? }\n if x.empty?\n if @cur_rule_index < @rules.size - 1\n last_rule = @cur_rule\n @cur_rule_index += 1\n @cur_rule = @rules[@cur_rule_index]\n # Go to the next date (except if the new rule is for the same weekday)\n @cur_date = next_game_date(@cur_date += 1, @cur_rule.wday) if last_rule.wday != @cur_rule.wday\n else\n @cur_rule_index = 0\n @cur_rule = @rules[@cur_rule_index]\n @cur_date = next_game_date(@cur_date += 1, @cur_rule.wday)\n end\n reset_resource_availability\n end\n end", "def end_time\n return nil if empty?\n @start_time + (@v.size-1).hours\n end", "def effective_end_time\n if start_time.nil?\n accommodated_end_time\n else\n [start_time + accommodated_duration, accommodated_end_time].min\n end\n end", "def fancy_end_at(event)\n tz_aware_end_date = event.end_at.in_time_zone(@event.timezone.source)\n\n if event.start_at + 1.day > event.end_at\n t(\"events.show.end_time.hours\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n elsif event.start_at + 2.days > event.end_at\n t(\"events.show.end_time.next_day\", time: tz_aware_end_date.to_s(:time),\n duration: event_duration(event))\n else\n t(\"events.show.end_time.arbitrary\", time: l(tz_aware_end_date, format: :default))\n end\n end", "def next_working_day(date_time)\n date_time = date_time + 1\n while !working_day?(date_time)\n date_time = date_time + 1\n end\n date_time\n end", "def next_occurring(day_of_week)\n from_now = DAYS_INTO_WEEK.fetch(day_of_week) - wday\n from_now += 7 unless from_now > 0\n advance(days: from_now)\n end", "def match_eod\n @_match_eod ||= matcher('End Of Day', 'event')\n end", "def reporthelp_end_time( form )\n return form.calendar_date_select(\n :range_end,\n {\n :embedded => false,\n :year_range => Timesheet.used_range()\n }\n )\n end", "def each_weekends_including_friday\n each_days_of_week(*([self.Fri] + self.WEEKENDS))\n end", "def get_registration_end_week\n registration_end_date.strftime('%W').to_i\n end", "def on_weekday?\n !WEEKEND_DAYS.include?(wday)\n end", "def daytime_intervals(s, e, day_start = 8, day_end = 21)\n def hours(x)\n x / 24.0\n end\n\n result = []\n\n # Temporary start and end variables. These are shifted around inplace.\n ts = s\n te = e\n\n while ts < e\n # Move ts forward in time as necessary until it is inside the time range\n unless (day_start...day_end).cover?(ts.hour)\n # Advance ts to next break\n if ts.hour < day_start\n ts += hours(day_start - ts.hour)\n else\n ts += hours(24 + day_start - ts.hour)\n end\n end\n\n # ts is in range now, check te\n if (day_start..day_end).cover?(te.hour) && te.to_date == ts.to_date\n # both ts and te are in range, so add the interval and reset both\n # variables\n result << [ts, te].map(&:to_s)\n ts = te\n te = e\n else\n # Modify te to be in range, the interval will be picked up on the next\n # loop assuming all variables are still valid.\n te = ts\n te += hours(day_end - ts.hour)\n end\n end\n\n result\nend", "def weekend(day)\n case\n\n when day == 'Saturday'\n return true\n when day == 'Sunday'\n return true\n else\n return false\n\nend\nend", "def ends_today\n all.select {|event| event.ends == (@date_for_test || Date.today)}\n end" ]
[ "0.6887679", "0.66346705", "0.6612159", "0.65665865", "0.6491254", "0.64626026", "0.6456308", "0.639722", "0.63921046", "0.6352652", "0.6317332", "0.6278184", "0.62594515", "0.6212975", "0.61278874", "0.6109816", "0.60801196", "0.6054199", "0.60504466", "0.6021319", "0.5987782", "0.59454125", "0.5913715", "0.5907207", "0.5885752", "0.5876672", "0.5862102", "0.58357465", "0.5812036", "0.5806033", "0.579261", "0.5763657", "0.57556355", "0.57345366", "0.5721536", "0.5709822", "0.5703869", "0.5640349", "0.5586627", "0.55820656", "0.55678356", "0.5534615", "0.5533919", "0.5526236", "0.5526236", "0.552557", "0.552557", "0.5515854", "0.5503387", "0.5488026", "0.54871154", "0.54861647", "0.5475444", "0.5444088", "0.5440603", "0.54311526", "0.5423977", "0.5403321", "0.540305", "0.53888804", "0.5354044", "0.533625", "0.5331668", "0.53307855", "0.5323016", "0.5321085", "0.53171766", "0.5315952", "0.5308365", "0.53010404", "0.5286166", "0.5276441", "0.5276441", "0.5276441", "0.5276441", "0.5276441", "0.5276441", "0.5276441", "0.5275407", "0.5260401", "0.5256183", "0.52543426", "0.52458674", "0.5230759", "0.52238244", "0.5216563", "0.52145123", "0.5210087", "0.52078944", "0.5196039", "0.51886183", "0.51885325", "0.5186995", "0.51813215", "0.5178755", "0.5172529", "0.51708865", "0.5162284", "0.51589537", "0.5157502" ]
0.5527699
43
TODO DEPRECATED METHODS Returns a RelativeTime object representing this OperatingTime
def relativeTime @relativeTime ||= RelativeTime.new(self, :opensAt, :length) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_time\r\n return @owner.timestamp.to_i - @start.to_i\r\n end", "def time\n Time.now.localtime + self.time_offset\n end", "def to_time\n self\n end", "def relative_time(time)\n stamp = time.getutc.iso8601\n %(<time class=\"ltr\" dir=\"ltr\" title=\"#{stamp}\" datetime=\"#{stamp}\">#{time}</time>)\n end", "def relative_time_element(time)\n time_element(time, 'js-relative-time')\n end", "def base_time\n BASE_TIME\n end", "def as_of_time\n @_as_of_time\n end", "def as_of_time\n @_as_of_time\n end", "def time\n @time ||= incorporate_utc_offset(@utc, utc_offset)\n end", "def poa_time\n # Check if there's a recipient, and if it has a timezone, it it does use that to set tz\n representative_tz_from_recipient = @hearing.representative_recipient&.timezone\n return normalized_time(representative_tz_from_recipient) if representative_tz_from_recipient.present?\n # If there's a virtual hearing, use that tz even if it's empty\n return normalized_time(@hearing.virtual_hearing[:representative_tz]) if @hearing.virtual_hearing.present?\n\n # No recipient and no virtual hearing? Use the normalized_time fallback\n normalized_time(nil)\n end", "def local_time\n iso_time\n end", "def time_offset\n calc_time_offset unless @time_offset\n @time_offset\n end", "def current_time\n begin\n Time.parse(self.localtime)\n rescue\n nil\n end\n end", "def current_time\n @current_time\n end", "def time\n end_time - start_time\n end", "def as_of_time\n Conversions.string_to_utc_time attributes_before_type_cast['as_of_time']\n end", "def as_of_time\n Conversions.string_to_utc_time attributes['as_of_time']\n end", "def calc_time_offset\n @last_time_offset = Time.now\n @time_offset = official_time - Time.now.localtime \n end", "def time_left(datetime=nil)\n unless datetime\n datetime = Time.zone.now\n end \n \n # weird rounding issue with the time difference?\n return (self.end_date - datetime).round\n end", "def time_based_attribute\n return @time_based_attribute\n end", "def from_now\n #if time.respond_to? :unix_timestamp\n # to_i - Time.unix_timestamp\n #else\n self - self.class.now\n #end\n end", "def current_time\n @definition.current_time\n end", "def time\n @ole.Time\n end", "def time\n @ole.Time\n end", "def time\n @ole.Time\n end", "def get_time_running\n\tu = get_unix_time\n\tt = -9\n\tif @TIME > 0\n\t\tt = u - @TIME\n\tend\nend", "def s_time\n to_form_time(start_time.getlocal)\n end", "def relative_time(to_time)\n duration = to_time - Time.current # it's in seconds\n secs, mins, days, months = duration_parts(duration)\n time = \"%-l:%M %p\" # time format\n\n # special cases based on dates\n return \"yesterday at #{time}\" if to_time.to_date == Date.yesterday\n return \"tomorrow at #{time}\" if to_time.to_date == Date.tomorrow\n\n # all other wordings are based on duration\n case duration\n when -INFINITY..-1.month then \"#{plural months, 'month'} ago\"\n when -1.month..-1.week then \"#{plural days, 'day'} ago\"\n when -1.week..-1.day then \"last %A at #{time}\"\n when -1.day..-1.hour then time\n when -1.hour..-1.minute then \"#{plural mins, 'minute'} ago (#{time})\"\n when -1.minute...0.seconds then \"#{plural secs, 'second'} ago (#{time})\"\n when 0.seconds then \"right now\"\n when 0.seconds...1.minute then \"#{plural secs, 'second'} from now (#{time})\"\n when 1.minute...1.hour then \"#{plural mins, 'minute'} from now (#{time})\"\n when 1.hour...1.day then time\n when 1.day...1.week then \"%A at #{time}\"\n when 1.week...1.month then \"#{plural days, 'day'} from now\"\n when 1.month...INFINITY then \"#{plural months, 'month'} from now\"\n else raise \"Congratulations, you won a bug!\"\n end\n end", "def reminder_date_time\n return @reminder_date_time\n end", "def time_base\n\t if @time_base.empty?\n\t\tTime.at(0)\n\t else\n\t\t@time_base.last[1] \n\t end\n\tend", "def time_base\n self[:time_base].to_f\n end", "def status_updated_date_time\n formatted_date_time(object.status_as_of)\n end", "def as_point_in_time\n if time\n time\n elsif start_time\n start_time\n else\n end_time\n end\n end", "def time\n start.try(:to_time).try(:strftime, '%-l:%M %P')\n end", "def sync_time(time)\n Time.local(self.dt.year, self.dt.mon, self.dt.mday, time.hour, time.min, time.sec)\n end", "def getTimer\n return @chrono.getTime()\n #return @chrono.to_s()\n end", "def right_now \n Time.now.getutc \n end", "def get_responsive_time\n current_time = Time.new\n (current_time - self.time_init)\n end", "def inizio_ora\n Time.new(self.year, self.month, self.day, self.hour)\n end", "def trip_time\n # puts scheduled_date.ai\n # puts scheduled_time.ai\n # DateTime.new(scheduled_date.year, scheduled_date.month, scheduled_date.day,\n # scheduled_time.hour, scheduled_time.min, 0, scheduled_time.offset)\n scheduled_time\n end", "def localtime\n # Opal 0.9.0 has no localtime method so use getlocal instead\n @time.getlocal\n end", "def to_time()\n #This is a stub, used for indexing\n end", "def endTimeFromNow() ;\n return endTimeFrom(Time.new()) ;\n end", "def time\n return Time.new(@t_year, @t_month, @t_day, @t_hour, @t_min, @t_sec)\n end", "def to_time\n Time.at(CF.CFDateGetAbsoluteTime(self) + CF.kCFAbsoluteTimeIntervalSince1970)\n end", "def current_time()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = TimeRef.new(Native.Timer_current_time(@handle.ptr))\n result\n end", "def to_time\n t = ::Time.at utc_reference\n Time.new t.utc\n end", "def currentTime( )\n dt = Time.new.gmtime.to_datetime()\n currentDate = dt.strftime( \"%s\" ) + \"=\" + dt.strftime( \"%F.%H:%M:%S\" )\n currentDate\n end", "def localtime\n Time.at(self.ut_tv_sec + self.ut_tv_usec / 1_000_000.0)\n end", "def time_modified(t=nil)\n if t.nil?\n t = DateTime.now.new_offset(0)\n elsif t.is_a? String\n t = DateTime.parse(t).new_offset(0)\n elsif t.is_a? Time\n t = t.utc\n elsif t.is_a? Date\n t = t.to_datetime.new_offset(0)\n elsif t.is_a? DateTime\n t = t.new_offset(0)\n end\n RDF::Literal.new(t, :datatype => RDF::XSD.dateTime)\n end", "def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end", "def self_time\n self.measurement.self_time\n end", "def internal_due_date_time\n return @internal_due_date_time\n end", "def time_class; end", "def to_time\n value\n end", "def now\n Time.really_now - time_travel_offsets.inject(0, :+)\n end", "def GetCurrDateTime\n\ttime1 = Time.new\n\tputs time1\n\tputs time1.inspect\nend", "def get_time\n Process.clock_gettime(Process::CLOCK_MONOTONIC)\n end", "def game_time()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = TimeSpanRef.new(Native.Time_game_time(@handle.ptr))\n if result.handle.ptr == nil\n return nil\n end\n result\n end", "def returned_date_time\n return @returned_date_time\n end", "def MeasuredAt\n super || DateTime.parse(self.LocalTime)\n end", "def fine_ora\n Time.new(self.year, self.month, self.day, self.hour, 59, 59)\n end", "def true_time( time_object )\n hours_to_sec = time_object.utc.hour * 60 * 60\n minutes_to_sec = time_object.utc.min * 60\n sec_to_sec = time_object.utc.sec\n hours_to_sec + minutes_to_sec + sec_to_sec\n end", "def to_time\n raise NotImplementedError\n end", "def time\n if @timezone then\n Time.use_zone(@timezone) {\n Time.zone.now\n }\n else\n Time.now\n end\n end", "def getlocal\n return Time.at(self).localtime\n end", "def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end", "def current_time\n DateTime.now\n end", "def current_time\n DateTime.now\n end", "def to_time\n if_period(super) do |p,t|\n # Ruby 2.4.0 changed the behaviour of to_time so that it preserves the\n # offset instead of converting to the system local timezone.\n #\n # When self has an associated TimezonePeriod, this implementation will\n # preserve the offset on all versions of Ruby.\n LocalTime.at(t.to_i, t.subsec * 1_000_000).localize(p)\n end\n end", "def getCurrentTime\n # Determine the current time and determine if we are in DST.\n return Time.mktime(@year, @month, @day, 0, 0, 0).gmtime\n end", "def current_time\n plan_rebuilder.current_time\n end", "def get_date()\n @time\n end", "def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end", "def time_of_day\n start.to_time.in_time_zone(device.zone).to_s(:local)\n end", "def calculate_time\n if @event.present? && @event.ends != nil\n event_time = @event.ends - @event.starts\n \n if event_time < 3600\n difference = ((event_time / 60) % 60)\n @event_difference = \"#{difference.round(0)} minutes\"\n else\n difference = event_time / (60 * 60)\n if difference == 1 \n @event_difference = \"#{difference.round(0)} hour\"\n else\n @event_difference = \"#{difference.round(1)} hours\"\n end\n end\n end\n end", "def current_time\n clock.now.to_f\n end", "def format_relative_time(time)\n distance_of_time_in_words_to_now(time, include_seconds: true)\n end", "def lead_time\n if completed_at\n completed_at - created_at\n else\n 0.0\n end\n end", "def start_time\n return @start_time\n end", "def to_time\n ::Time.at(self.getTime/1000)\n end", "def time\n #Parse the raw time into a binary time structure...\n time = send_request(Packets::RequestTime.new)\n\n #And convert that to a ruby time.\n time.to_time()\n end", "def applied_date_time\n return @applied_date_time\n end", "def base\n @base_time\n end", "def time_now\n ::Time.now\n end", "def current_offset\n ::Time.new.utc_offset\n end", "def __mongoize_time__\n ::Time.configured.local(*self)\n end", "def to_time\n if preserve_timezone\n @to_time_with_instance_offset ||= getlocal(utc_offset)\n else\n @to_time_with_system_offset ||= getlocal\n end\n end", "def iso_time\n @iso_time ||= Time.now.utc.iso8601\n end", "def start_time\n self.day\n end", "def __evolve_time__\n __mongoize_time__.utc\n end", "def start_time\n self.date\n end", "def to_time\n\t\tself.offset == 0 ? ::Time.utc_time(year, month, day, hour, min, sec, sec_fraction * (RUBY_VERSION < '1.9' ? 86400000000 : 1000000)) : self\n\tend", "def get_time\n\t\t@time.inspect\n\tend", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def time\n \tself[:time].try(:in_time_zone, \"Eastern Time (US & Canada)\")\n end", "def time\n return @time\n end", "def set_current_time_as_adjusted\n self.adjusted_at = Time.current\n end", "def getTripTime()\n return Trip.new(getPickUpTime(), getDropOffTime()) ;\n end" ]
[ "0.65414953", "0.64402467", "0.6255717", "0.6231243", "0.61912125", "0.6088688", "0.6035321", "0.6035321", "0.6031371", "0.5978721", "0.5962981", "0.59468776", "0.59287286", "0.59149784", "0.5897135", "0.5892174", "0.5857807", "0.584655", "0.58331233", "0.58246064", "0.5824245", "0.58241785", "0.57892597", "0.57892597", "0.57892597", "0.57842207", "0.577284", "0.5769448", "0.57675904", "0.57578766", "0.575196", "0.5748319", "0.5736559", "0.57329583", "0.57313627", "0.57293963", "0.5718995", "0.5715096", "0.5713843", "0.5708873", "0.56948435", "0.5683085", "0.56772715", "0.5660367", "0.56558776", "0.56513166", "0.56505", "0.56369203", "0.56345075", "0.56291485", "0.56266826", "0.5622707", "0.56225336", "0.56220853", "0.5612415", "0.5612157", "0.5610655", "0.5609182", "0.5607828", "0.5602619", "0.55997497", "0.5596307", "0.5592038", "0.55871797", "0.55855036", "0.5584773", "0.5579995", "0.5576279", "0.5576279", "0.5570653", "0.55620676", "0.5557442", "0.5556749", "0.5555905", "0.5547754", "0.5542489", "0.554208", "0.5539779", "0.55393785", "0.5531359", "0.55311507", "0.5528302", "0.55060893", "0.54937214", "0.5489335", "0.54881144", "0.5485864", "0.5484019", "0.54773843", "0.5475608", "0.5472796", "0.5470265", "0.54678124", "0.54554594", "0.5454314", "0.5454314", "0.5453568", "0.54534495", "0.5453291", "0.54484004" ]
0.7810221
0
Backwards compatibility with old database schema TODO GET RID OF THIS!!!
def flags ( (override ? 1 : 0) << 7) | read_attribute(:days_of_week) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_new_schema\n AssociatedRecord.reset_column_information\n DeeplyAssociatedRecord.reset_column_information\n\n AssociatedRecord.cached_primary_index.send(:instance_variable_set, :@cache_key_prefix, nil)\n Item.cached_primary_index.send(:instance_variable_set, :@cache_key_prefix, nil)\n end", "def target_sql_mode; end", "def skip_schema_queries; end", "def sql_modes; end", "def standard_sql?\n !legacy_sql?\n end", "def schema\n execute(<<-eosql).collect { |row| row[0] }.collect { |t| table_schema(t) }\nSELECT rdb$relation_name FROM rdb$relations WHERE rdb$system_flag != 1\neosql\n end", "def version; schema.version; end", "def target_sql_mode=(_arg0); end", "def orm; end", "def table_schema(tbl)\n column_sql = <<-eosql\nSELECT rf.rdb$field_name AS \"name\",\n field.rdb$field_type AS \"type_code\",\n field.rdb$field_sub_type AS \"subtype_code\",\n-- -- -- field.rdb$field_length AS \"length\", -- -- --\n field.rdb$field_precision AS \"precision\",\n field.rdb$field_scale AS \"scale\",\n CASE\n WHEN rf.rdb$null_flag > 0\n THEN 'NO'\n ELSE 'YES'\n END AS \"nullable\",\n CASE\n WHEN iseg.rdb$index_name IS NOT NULL\n THEN 'YES'\n ELSE 'NO'\n END AS \"primary_key\"\nFROM rdb$relation_fields rf\nJOIN rdb$fields field ON rf.rdb$field_source = field.rdb$field_name\nLEFT JOIN rdb$relation_constraints c\n ON c.rdb$relation_name = rf.rdb$relation_name\n AND\n c.rdb$constraint_type = 'PRIMARY KEY'\nLEFT JOIN rdb$index_segments iseg\n ON iseg.rdb$index_name = c.rdb$index_name\n AND\n iseg.rdb$field_name = rf.rdb$field_name\nWHERE rf.rdb$relation_name = ?\nORDER BY rf.rdb$field_position, rf.rdb$field_name\neosql\n\n info = RDBI::Schema.new([], [])\n res = execute(column_sql, tbl.to_s.upcase)\n res.as(:Struct)\n while row = res.fetch[0]\n type = RDBI::Driver::Rubyfb::Types::field_type_to_rubyfb(row[:type_code], row[:subtype_code])\n info.columns << RDBI::Column.new(\n row[:name].to_sym,\n type,\n RDBI::Driver::Rubyfb::Types::rubyfb_to_rdbi(type, row[:scale]),\n row[:precision],\n row[:scale],\n row[:nullable] == 'YES',\n #nil, # metadata\n #nil, # default\n #nil, # table\n )\n (info.columns[-1].primary_key = row[:primary_key] == 'YES') rescue nil # pk > rdbi 0.9.1\n end\n return unless info.columns.length > 0\n info.tables << tbl\n info\n end", "def _schema_ds\n @_schema_ds ||= begin\n ds = metadata_dataset.select{[\n pg_attribute[:attname].as(:name),\n SQL::Cast.new(pg_attribute[:atttypid], :integer).as(:oid),\n SQL::Cast.new(basetype[:oid], :integer).as(:base_oid),\n SQL::Function.new(:format_type, basetype[:oid], pg_type[:typtypmod]).as(:db_base_type),\n SQL::Function.new(:format_type, pg_type[:oid], pg_attribute[:atttypmod]).as(:db_type),\n SQL::Function.new(:pg_get_expr, pg_attrdef[:adbin], pg_class[:oid]).as(:default),\n SQL::BooleanExpression.new(:NOT, pg_attribute[:attnotnull]).as(:allow_null),\n SQL::Function.new(:COALESCE, SQL::BooleanExpression.from_value_pairs(pg_attribute[:attnum] => SQL::Function.new(:ANY, pg_index[:indkey])), false).as(:primary_key),\n Sequel[:pg_type][:typtype],\n (~Sequel[Sequel[:elementtype][:oid]=>nil]).as(:is_array),\n ]}.\n from(:pg_class).\n join(:pg_attribute, :attrelid=>:oid).\n join(:pg_type, :oid=>:atttypid).\n left_outer_join(Sequel[:pg_type].as(:basetype), :oid=>:typbasetype).\n left_outer_join(Sequel[:pg_type].as(:elementtype), :typarray=>Sequel[:pg_type][:oid]).\n left_outer_join(:pg_attrdef, :adrelid=>Sequel[:pg_class][:oid], :adnum=>Sequel[:pg_attribute][:attnum]).\n left_outer_join(:pg_index, :indrelid=>Sequel[:pg_class][:oid], :indisprimary=>true).\n where{{pg_attribute[:attisdropped]=>false}}.\n where{pg_attribute[:attnum] > 0}.\n order{pg_attribute[:attnum]}\n\n # :nocov:\n if server_version > 100000\n # :nocov:\n ds = ds.select_append{pg_attribute[:attidentity]}\n\n # :nocov:\n if server_version > 120000\n # :nocov:\n ds = ds.select_append{Sequel.~(pg_attribute[:attgenerated]=>'').as(:generated)}\n end\n end\n\n ds\n end\n end", "def functional_update_schema # abstract\n raise 'abstract'\n end", "def real_column; end", "def schema\n raise NotImplementedError\n end", "def orm_patches_applied; end", "def skip_schema_queries=(_arg0); end", "def target_postgresql_version; end", "def extended_types\n EXTENDED_DATABASE_TYPES\n end", "def schema(&block)\n ActiveRecord::Schema.define(version: 0, &block)\nend", "def aggregate_db_storage_type; end", "def subscribe_sql_active_record; end", "def use_column_schema_to_ruby_default_fallback?\n database_type != :mysql\n end", "def use_column_schema_to_ruby_default_fallback?\n database_type != :mysql\n end", "def get_schema_id()\n\t\tend", "def target_postgresql_version=(_arg0); end", "def schema_meta_structure\n CreateVersionsTableQuery.new.to_cql\n end", "def connect_to_old_db\n ActiveRecord::Base.establish_connection(\n :adapter => \"postgresql\",\n :host => \"localhost\",\n :username => \"postgres\",\n :password => \"vegpuf\",\n :database => \"affluence_staging_25_june\"\n )\nend", "def schema\n adapter.schema\n end", "def single_object_db; end", "def alter_schemata\n end", "def alter_schemata\n end", "def table_name_prefix; end", "def target_mysql_version; end", "def tables; ActiveRecord::Base.connection.tables; end", "def get_schema_level()\n\t\tend", "def snapshots_redact_sql_queries; end", "def cross_schema_support?\n @cross_schema_support ||= (config[:adapter] =~ /(mysql)|(postgres)|(sqlserver)/i)\n end", "def schema\n if @old_schema.nil?\n @old_schema = Schema.new(get(link('schema')))\n end\n return @old_schema \n end", "def database_type\n :fdbsql\n end", "def native_database_types\n {\n :primary_key => \"integer not null primary key\",\n :string => { :name => \"varchar\", :limit => 255 },\n :text => { :name => \"blob sub_type text\" },\n :integer => { :name => \"integer\" },\n :float => { :name => \"float\" },\n :decimal => { :name => \"decimal\" },\n :datetime => { :name => \"timestamp\" },\n :timestamp => { :name => \"timestamp\" },\n :time => { :name => \"time\" },\n :date => { :name => \"date\" },\n :binary => { :name => \"blob\" },\n :boolean => { :name => boolean_domain[:name] }\n }\n end", "def reload_db_schema?\n false\n end", "def reload_db_schema?\n false\n end", "def setup_db\n ActiveRecord::Schema.define(:version => 1) do\n create_table :users do |t|\n t.string :email, :limit => 255\n t.string :crypted_password, :limit => 255\n \n t.timestamps\n end\n end\n \n ActiveRecord::Schema.define(:version => 1) do\n create_table :labels do |t|\n t.string :type, :limit => 255\n t.string :system_label, :limit => 255\n t.string :label, :limit => 255\n \n t.timestamps\n end\n end\nend", "def schema\n self.class.schema\n end", "def legacy_sql?\n val = @gapi.configuration.query.use_legacy_sql\n return true if val.nil?\n val\n end", "def real_table_name\n packageid.gsub('.', '_')\n end", "def ext_schema\n @ext_schema ||= schema_versions[\"relaton-model-omg\"]\n end", "def native_database_types #:nodoc:\r\n {\r\n :primary_key => 'AUTOINC PRIMARY KEY CONSTRAINT NOT NULL',\r\n :string => { :name => \"varchar\", :limit => 255 },\r\n :text => { :name => \"memo\" },\r\n :integer => { :name => \"integer\" },\r\n :float => { :name => \"float\" },\r\n :decimal => { :name => \"numeric\" },\r\n :datetime => { :name => \"timestamp\" },\r\n :timestamp => { :name => \"timestamp\" },\r\n :time => { :name => \"time\" },\r\n :date => { :name => \"date\" },\r\n :binary => { :name => \"blob\" },\r\n :boolean => { :name => \"logical\"}\r\n }\r\n end", "def chooseSchema\n @metadata.chooseSchema\n end", "def schema_search_path\n 'dbo'\n end", "def get_schema_level\n\t\tend", "def pre_migrate_database\n old_schema_version = get_schema_version\n new_schema_version = File.read(File.join(source_directory,'db','schema_version')).to_i\n \n return unless old_schema_version > 0\n \n # Are we downgrading?\n if old_schema_version > new_schema_version\n message \"Downgrading schema from #{old_schema_version} to #{new_schema_version}\"\n \n in_directory install_directory do\n unless system(\"rake -s migrate VERSION=#{new_schema_version}\")\n raise InstallFailed, \"Downgrade migrating from #{old_schema_version} to #{new_schema_version} failed.\"\n end\n end\n end\n end", "def validate_schema\n all_cols1 = @db1.column_names(@table1)\n all_cols2 = @db2.column_names(@table2)\n if all_cols1 != all_cols2\n raise \"Columns do not match, please use full coopy toolbox\"\n end\n\n key_cols1 = @db1.primary_key(@table1)\n key_cols2 = @db2.primary_key(@table2)\n if key_cols1 != key_cols2\n raise \"Primary keys do not match, please use full coopy toolbox\"\n end\n end", "def validate_schema\n all_cols1 = @db1.column_names(@table1)\n all_cols2 = @db2.column_names(@table2)\n if all_cols1 != all_cols2\n raise \"Columns do not match, please use full coopy toolbox\"\n end\n\n key_cols1 = @db1.primary_key(@table1)\n key_cols2 = @db2.primary_key(@table2)\n if key_cols1 != key_cols2\n raise \"Primary keys do not match, please use full coopy toolbox\"\n end\n end", "def validate_schema\n all_cols1 = @db1.column_names(@table1)\n all_cols2 = @db2.column_names(@table2)\n if all_cols1 != all_cols2\n raise \"Columns do not match, please use full coopy toolbox\"\n end\n\n key_cols1 = @db1.primary_key(@table1)\n key_cols2 = @db2.primary_key(@table2)\n if key_cols1 != key_cols2\n raise \"Primary keys do not match, please use full coopy toolbox\"\n end\n end", "def get_schema_sql(table_struct, table_name = NEW_TABLE_NAME)\n dbstruct = []\n pkeys = []\n\n table_struct.each do | row |\n dbstruct << \"`#{row[:field]}` #{row[:type]} #{(!row[:default].nil? && row[:default] != '' ) ? \"default '#{row[:default]}'\" : ''} #{row[:null] == 'NO' ? 'NOT NULL' : ''}\"\n pkeys << \"`#{row[:field]}`\" if row[:key] == 'PRI'\n end \n\n dbstruct << \"PRIMARY KEY (%s)\" % [pkeys.join(', ')]\n dbstring = \"CREATE TABLE `%s` (\\n\\t%s\\n)\" % [table_name, dbstruct.join(\",\\n\\t\")]\n\n dbstring\nend", "def postgresql_version\n 100000\n end", "def sql_state; end", "def for_database_key\n self.without_type\n end", "def schema\n self\n end", "def on_table?; @on_table; end", "def tables\n ActiveRecord::Base.connection.tables.sort!\nend", "def recreate_column(name, schema, gen, options)\n if options[:single_pk] && schema_autoincrementing_primary_key?(schema)\n type_hash = options[:same_db] ? {:type=>schema[:db_type]} : column_schema_to_ruby_type(schema)\n [:table, :key, :on_delete, :on_update, :deferrable].each{|f| type_hash[f] = schema[f] if schema[f]}\n if type_hash == {:type=>Integer} || type_hash == {:type=>\"integer\"} || type_hash == {:type=>\"INTEGER\"}\n type_hash.delete(:type)\n elsif options[:same_db] && type_hash == {:type=>type_literal_generic_bignum_symbol(type_hash).to_s}\n type_hash[:type] = :Bignum\n end\n\n unless gen.columns.empty?\n type_hash[:keep_order] = true\n end\n\n if type_hash.empty?\n gen.primary_key(name)\n else\n gen.primary_key(name, type_hash)\n end\n else\n col_opts = if options[:same_db]\n h = {:type=>schema[:db_type]}\n if database_type == :mysql && h[:type] =~ /\\Atimestamp/\n h[:null] = true\n end\n if database_type == :mssql && schema[:max_length]\n h[:size] = schema[:max_length]\n end\n h\n else\n column_schema_to_ruby_type(schema)\n end\n type = col_opts.delete(:type)\n if col_opts.key?(:size) && col_opts[:size].nil?\n col_opts.delete(:size)\n if max_length = schema[:max_length]\n col_opts[:size] = max_length\n end\n end\n if schema[:generated]\n if options[:same_db] && database_type == :postgres\n col_opts[:generated_always_as] = column_schema_to_ruby_default_fallback(schema[:default], options)\n end\n else\n col_opts[:default] = if schema[:ruby_default].nil?\n column_schema_to_ruby_default_fallback(schema[:default], options)\n else\n schema[:ruby_default]\n end\n col_opts.delete(:default) if col_opts[:default].nil?\n end\n col_opts[:null] = false if schema[:allow_null] == false\n if table = schema[:table]\n [:key, :on_delete, :on_update, :deferrable].each{|f| col_opts[f] = schema[f] if schema[f]}\n col_opts[:type] = type unless type == Integer || type == 'integer' || type == 'INTEGER'\n gen.foreign_key(name, table, col_opts)\n else\n gen.column(name, type, col_opts)\n if [Integer, :Bignum, Float, BigDecimal].include?(type) && schema[:db_type] =~ / unsigned\\z/io\n gen.check(Sequel::SQL::Identifier.new(name) >= 0)\n end\n end\n end\n end", "def get_schema_struct(table_name)\n dbres = do_sql_command(\"DESC #{table_name};\")\n\n dbstruct = []\n\n if(dbres) then\n dbres.each_hash do | row |\n dbstruct_hash = {}\n row.each {|key, val|\n dbstruct_hash[key.downcase.to_sym] = val \n }\n dbstruct << dbstruct_hash\n end \n end\n\n dbstruct\nend", "def database_version\n raise NoMethodError, \"Not implemented for this raw driver\"\n end", "def copy_table_structure(rdb,tbl)\n template = \"SELECT sql, type from X.sqlite_master WHERE tbl_name = ? ORDER BY type DESC\"\n lsql = template.gsub('X',\"main\")\n rsql = template.gsub('X',quote_with_dots(rdb))\n args = [quote_with_dots(tbl)]\n lschema = sqlite_execute(lsql,args)\n rschema = sqlite_execute(rsql,args)\n if lschema.length>0\n return false\n end\n rschema.each{ |row| sqlite_execute(row[0],[]) }\n true\n end", "def copy_table_structure(rdb,tbl)\n template = \"SELECT sql, type from X.sqlite_master WHERE tbl_name = ? ORDER BY type DESC\"\n lsql = template.gsub('X',\"main\")\n rsql = template.gsub('X',quote_with_dots(rdb))\n args = [quote_with_dots(tbl)]\n lschema = sqlite_execute(lsql,args)\n rschema = sqlite_execute(rsql,args)\n if lschema.length>0\n return false\n end\n rschema.each{ |row| sqlite_execute(row[0],[]) }\n true\n end", "def copy_table_structure(rdb,tbl)\n template = \"SELECT sql, type from X.sqlite_master WHERE tbl_name = ? ORDER BY type DESC\"\n lsql = template.gsub('X',\"main\")\n rsql = template.gsub('X',quote_with_dots(rdb))\n args = [quote_with_dots(tbl)]\n lschema = sqlite_execute(lsql,args)\n rschema = sqlite_execute(rsql,args)\n if lschema.length>0\n return false\n end\n rschema.each{ |row| sqlite_execute(row[0],[]) }\n true\n end", "def oracle; end", "def schema_parse_table(table_name, opts)\n m = output_identifier_meth(opts[:dataset])\n\n _schema_ds.where_all(Sequel[:pg_class][:oid]=>regclass_oid(table_name, opts)).map do |row|\n row[:default] = nil if blank_object?(row[:default])\n if row[:base_oid]\n row[:domain_oid] = row[:oid]\n row[:oid] = row.delete(:base_oid)\n row[:db_domain_type] = row[:db_type]\n row[:db_type] = row.delete(:db_base_type)\n else\n row.delete(:base_oid)\n row.delete(:db_base_type)\n end\n\n db_type = row[:db_type]\n row[:type] = if row.delete(:is_array)\n schema_array_type(db_type)\n else\n send(TYPTYPE_METHOD_MAP[row.delete(:typtype)], db_type)\n end\n identity = row.delete(:attidentity)\n if row[:primary_key]\n row[:auto_increment] = !!(row[:default] =~ /\\A(?:nextval)/i) || identity == 'a' || identity == 'd'\n end\n\n # :nocov:\n if server_version >= 90600\n # :nocov:\n case row[:oid]\n when 1082\n row[:min_value] = MIN_DATE\n row[:max_value] = MAX_DATE\n when 1184, 1114\n if Sequel.datetime_class == Time\n row[:min_value] = MIN_TIMESTAMP\n row[:max_value] = MAX_TIMESTAMP\n end\n end\n end\n\n [m.call(row.delete(:name)), row]\n end\n end", "def migrate\n ActiveRecord::Schema.define do\n self.verbose = true # or false\n\n enable_extension \"plpgsql\"\n #enable_extension \"pgcrypto\"\n\n create_table(:access_lines, force: true) do |t|\n t.string :line, null: false\n t.datetime :timestamp, null: false\n t.string :username, null: false\n t.string :peer_id, null: false\n end\n\n # A backup for the uniqueness validation in AccessLine\n add_index :access_lines, [:timestamp, :username], unique: true\n end\n end", "def orm_patches_applied=(_arg0); end", "def table\n Identity\n end", "def table\n Identity\n end", "def relation_by_sql_form\n # Nothing to do here\n end", "def schema_and_table(result)\n :\"#{result.schema}__#{self.implicit_table_name}\"\n end", "def database_type\n :oracle\n end", "def target_mysql_version=(_arg0); end", "def table_name; \"gdo_module\"; end", "def __foreign_key_list_ds(reverse)\n if reverse\n ctable = Sequel[:att2]\n cclass = Sequel[:cl2]\n rtable = Sequel[:att]\n rclass = Sequel[:cl]\n else\n ctable = Sequel[:att]\n cclass = Sequel[:cl]\n rtable = Sequel[:att2]\n rclass = Sequel[:cl2]\n end\n\n if server_version >= 90500\n cpos = Sequel.expr{array_position(co[:conkey], ctable[:attnum])}\n rpos = Sequel.expr{array_position(co[:confkey], rtable[:attnum])}\n # :nocov:\n else\n range = 0...32\n cpos = Sequel.expr{SQL::CaseExpression.new(range.map{|x| [SQL::Subscript.new(co[:conkey], [x]), x]}, 32, ctable[:attnum])}\n rpos = Sequel.expr{SQL::CaseExpression.new(range.map{|x| [SQL::Subscript.new(co[:confkey], [x]), x]}, 32, rtable[:attnum])}\n # :nocov:\n end\n\n ds = metadata_dataset.\n from{pg_constraint.as(:co)}.\n join(Sequel[:pg_class].as(cclass), :oid=>:conrelid).\n join(Sequel[:pg_attribute].as(ctable), :attrelid=>:oid, :attnum=>SQL::Function.new(:ANY, Sequel[:co][:conkey])).\n join(Sequel[:pg_class].as(rclass), :oid=>Sequel[:co][:confrelid]).\n join(Sequel[:pg_attribute].as(rtable), :attrelid=>:oid, :attnum=>SQL::Function.new(:ANY, Sequel[:co][:confkey])).\n join(Sequel[:pg_namespace].as(:nsp), :oid=>Sequel[:cl2][:relnamespace]).\n order{[co[:conname], cpos]}.\n where{{\n cl[:relkind]=>%w'r p',\n co[:contype]=>'f',\n cpos=>rpos\n }}.\n select{[\n co[:conname].as(:name),\n ctable[:attname].as(:column),\n co[:confupdtype].as(:on_update),\n co[:confdeltype].as(:on_delete),\n cl2[:relname].as(:table),\n rtable[:attname].as(:refcolumn),\n SQL::BooleanExpression.new(:AND, co[:condeferrable], co[:condeferred]).as(:deferrable),\n nsp[:nspname].as(:schema)\n ]}\n\n if reverse\n ds = ds.order_append(Sequel[:nsp][:nspname], Sequel[:cl2][:relname])\n end\n\n ds\n end", "def postgresql_version\n if undecorated_connection.respond_to?(:postgresql_version)\n super\n else\n undecorated_connection.send(:postgresql_version)\n end\n end", "def postgresql_version\n if undecorated_connection.respond_to?(:postgresql_version)\n super\n else\n undecorated_connection.send(:postgresql_version)\n end\n end", "def sid_column\n end", "def select(db); end", "def select(db); end", "def get_schema_version\n File.read(File.join(install_directory,'db','schema_version')).to_i rescue 0\n end", "def schema(obj)\n y(obj.send(\"column_names\"))\nend", "def db; end", "def db; end", "def getDatabaseType\n return ActiveRecord::Base.connection.adapter_name\n end", "def tables\n [\n ]\n end", "def migrate\n raise NotImplementedError\n end", "def check_metadata\n version = @db[:schema_info].first\n unless version[:magic] == Bitcoin.network[:magic_head].hth\n name = Bitcoin::NETWORKS.find{|n,d| d[:magic_head].hth == version[:magic]}[0]\n raise \"Error: DB #{@db.url} was created for '#{name}' network!\"\n end\n unless version[:backend] == backend_name\n # rename \"sequel\" to \"archive\" when old db is opened\n if version[:backend] == \"sequel\" && backend_name == \"archive\"\n @db[:schema_info].update(backend: \"archive\")\n else\n raise \"Error: DB #{@db.url} was created for '#{version[:backend]}' backend!\"\n end\n end\n end", "def dbms_type_cast(columns, rows)\n # Cast the values to the correct type\n columns.each_with_index do |column, col_index|\n #puts \" #{column.name} type #{column.type} length #{column.length} nullable #{column.nullable} scale #{column.scale} precision #{column.precision} searchable #{column.searchable} unsigned #{column.unsigned}\"\n rows.each do |row|\n value = row[col_index]\n\n new_value = case\n when value.nil?\n nil\n when [ODBC::SQL_CHAR, ODBC::SQL_VARCHAR, ODBC::SQL_LONGVARCHAR].include?(column.type)\n # Do nothing, because the data defaults to strings\n # This also covers null values, as they are VARCHARs of length 0\n value.is_a?(String) ? value.force_encoding(\"UTF-8\") : value\n when [ODBC::SQL_DECIMAL, ODBC::SQL_NUMERIC].include?(column.type)\n column.scale == 0 ? value.to_i : value.to_f\n when [ODBC::SQL_REAL, ODBC::SQL_FLOAT, ODBC::SQL_DOUBLE].include?(column.type)\n value.to_f\n when [ODBC::SQL_INTEGER, ODBC::SQL_SMALLINT, ODBC::SQL_TINYINT, ODBC::SQL_BIGINT].include?(column.type)\n value.to_i\n when [ODBC::SQL_BIT].include?(column.type)\n value == 1\n when [ODBC::SQL_DATE, ODBC::SQL_TYPE_DATE].include?(column.type)\n value.to_date\n when [ODBC::SQL_TIME, ODBC::SQL_TYPE_TIME].include?(column.type)\n value.to_time\n when [ODBC::SQL_DATETIME, ODBC::SQL_TIMESTAMP, ODBC::SQL_TYPE_TIMESTAMP].include?(column.type)\n value.to_datetime\n # when [\"ARRAY\"?, \"OBJECT\"?, \"VARIANT\"?].include?(column.type)\n # TODO: \"ARRAY\", \"OBJECT\", \"VARIANT\" all return as VARCHAR\n # so we'd need to parse them to make them the correct type\n\n # As of now, we are just going to return the value as a string\n # and let the consumer handle it. In the future, we could handle\n # if here, but there's not a good way to tell what the type is\n # without trying to parse the value as JSON as see if it works\n # JSON.parse(value)\n when [ODBC::SQL_BINARY].include?(column.type)\n # These don't actually ever seem to return, even though they are\n # defined in the ODBC driver, but I left them in here just in case\n # so that future us can see what they should be\n value\n else\n # the use of @connection.types() results in a \"was not dropped before garbage collection\" warning.\n raise \"Unknown column type: #{column.type} #{@connection.types(column.type).first[0]}\"\n end\n\n row[col_index] = new_value\n end\n end\n rows\n end", "def initialize_database \n Object.send :const_set, :ORD, ActiveOrient::OrientDB.new( preallocate: false )\n if OrientDB::UsingJava\n Object.send :const_set, :DB, ActiveOrient::API.new( preallocate: false )\n else\n Object.send :const_set, :DB, ORD # ActiveOrient::OrientDB.new( preallocate: true )\n end\n\nend", "def initialize_database \n Object.send :const_set, :ORD, ActiveOrient::OrientDB.new( preallocate: false )\n if OrientDB::UsingJava\n Object.send :const_set, :DB, ActiveOrient::API.new( preallocate: false )\n else\n Object.send :const_set, :DB, ORD # ActiveOrient::OrientDB.new( preallocate: true )\n end\n\nend", "def schema_composite_type(db_type)\n @row_schema_types[db_type] || super\n end", "def table; end", "def table; end", "def table; end", "def table; end" ]
[ "0.6499884", "0.64268947", "0.6419232", "0.63254976", "0.62552696", "0.6207963", "0.6176072", "0.6157932", "0.61382", "0.6098865", "0.6047233", "0.59738535", "0.5945883", "0.5927769", "0.58752453", "0.5833171", "0.57681584", "0.57356924", "0.5732324", "0.573167", "0.5729477", "0.56606317", "0.56606317", "0.562659", "0.5586341", "0.5578899", "0.5565996", "0.5562593", "0.5544089", "0.55380917", "0.55380917", "0.5531816", "0.5522026", "0.55200505", "0.55154115", "0.5498526", "0.54819167", "0.54765916", "0.54645824", "0.5461352", "0.54496545", "0.54496545", "0.54355544", "0.5428767", "0.54278845", "0.54249597", "0.5420672", "0.5419961", "0.54187906", "0.54146004", "0.5413049", "0.5406383", "0.5403523", "0.5403523", "0.5403523", "0.5400107", "0.539811", "0.539773", "0.5393808", "0.539379", "0.5392895", "0.53913575", "0.5386685", "0.537085", "0.5367811", "0.5366004", "0.5366004", "0.5366004", "0.5359087", "0.53573537", "0.5356746", "0.53552365", "0.535427", "0.535427", "0.53527856", "0.53487515", "0.5345468", "0.5343255", "0.5339302", "0.5334754", "0.5332727", "0.5332406", "0.53264606", "0.53123504", "0.53123504", "0.5299384", "0.52907175", "0.5287852", "0.5287852", "0.528199", "0.52675796", "0.5266012", "0.52627325", "0.5249379", "0.52492386", "0.52492386", "0.52452797", "0.52439064", "0.52439064", "0.52439064", "0.52439064" ]
0.0
-1
FIXME Deprecated, use +override+ instead
def special override end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overrides; end", "def source(override); end", "def super_method; end", "def tag; raise 'Override this method'; end", "def custom; end", "def custom; end", "def inherited(base); end", "def overrides=(_arg0); end", "def virtual; end", "def proxy\n super\n end", "def private; end", "def super_class; end", "def super_class; end", "def superclass() end", "def implementation; end", "def implementation; end", "def original_method; end", "def extended(*) end", "def inherited(klass); end", "def inherited(klass); end", "def override() # Note that despite the module.override, this still overrides\r\n puts \"CHILD override()\"\r\n end", "def override()\n puts \"CHILD override()\"\n end", "def invoke\r\n # TODO: rename to more appropriate one 2007/05/10 by shino\r\n raise 'must be implemented in subclasses'\r\n end", "def import\n raise \"#{self.class.name}::#{__method__} must be overridden\"\n end", "def original; end", "def overload; end", "def protocol\n super\n end", "def inherited(subclass); end", "def invoke\n raise NotImplementedError, \"Author of subclass forgot to implement #invoke\"\n end", "def delegating_method; end", "def type; super; end", "def call\n # implement in subclasses\n end", "def public_instance_methods(include_super=true) end", "def base; self; end", "def name; super; end", "def name; super; end", "def foo(...)\n super(...)\nend", "def modify\n super\n end", "def use(*)\n super\n end", "def protected_instance_methods(include_super=true) end", "def base_class; end", "def instance_methods(include_super=true) end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def method; end", "def extended( hooked_instance )\n\n super if defined?( super )\n \n end", "def abstract!; end", "def internal; end", "def calls_super # :nodoc:\n false\n end", "def call\n raise NotImplementedError,\n \"Override #call and implement your application logic.\"\n end", "def private_instance_methods(include_super=true) end", "def macro; raise NotImplementedError; end", "def macro; raise NotImplementedError; end", "def macro; raise NotImplementedError; end", "def method_missing(method, *args, &block)\n super unless original_self\n original_self.send method, *args, &block\n end", "def wrapper; end", "def protected_method\n end", "def run\n super\n end", "def run\n super\n end", "def methods; end", "def methods; end", "def methods; end", "def methods; end", "def example_override(id)\n # code goes here\n end", "def private_method\n end", "def method_missing(method_name, *args, &block)\n base.respond_to?(method_name) ? base.send(method_name, *args, &block) : super\n end", "def respond_to_missing?(*_args); super; end", "def call\n raise \"Must subclass and implement call\"\n end", "def mss_override\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def new\n super\n end", "def choose\n raise NotImplementedError.new('Must override')\n end", "def specie; end", "def specie; end", "def specie; end" ]
[ "0.8639842", "0.76268375", "0.75826335", "0.75562793", "0.74351907", "0.74351907", "0.74229366", "0.7329519", "0.7291582", "0.72717106", "0.7223582", "0.7076081", "0.7076081", "0.7038899", "0.69644564", "0.69644564", "0.69512624", "0.6944975", "0.69274217", "0.69274217", "0.6908523", "0.69015", "0.6886592", "0.6873006", "0.6810965", "0.67983854", "0.67453", "0.67369586", "0.67205876", "0.671711", "0.67136925", "0.6700569", "0.66952807", "0.6694592", "0.6663162", "0.6663162", "0.6636975", "0.6616785", "0.66010207", "0.65903074", "0.6577961", "0.6554212", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.654224", "0.6531885", "0.65092534", "0.64931154", "0.6491493", "0.64783454", "0.647541", "0.6473001", "0.6473001", "0.6473001", "0.64575154", "0.645335", "0.64478344", "0.64299995", "0.64299995", "0.6420574", "0.6420574", "0.6420574", "0.6420574", "0.6419172", "0.640357", "0.6389306", "0.637744", "0.63762164", "0.637026", "0.6368494", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6367627", "0.6366999", "0.6366839", "0.6366839", "0.6366839" ]
0.7944929
1
Input: isSpecial = true/false FIXME Deprecated, use +override=+ instead
def special=(isSpecial) if isSpecial == true or isSpecial == "true" or isSpecial == 1 self.override = true elsif isSpecial == false or isSpecial == "false" or isSpecial == 0 self.override = false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def special\n override\n end", "def special=(value)\n @special = value\n end", "def specialty; end", "def is_special?\n\n [ '*embedded*', '*untracked*' ].include?(self.name)\n end", "def overrides; end", "def enotsup?() super; end", "def set_normal!\n @wildcard = false\n @absorbent = false\n end", "def nooverride()\n merge(tbnooverride: 'true')\n end", "def special\n return @special\n end", "def method_missing(meth, *args, &block)\n if meth.to_s =~ /^(\\w*)\\?$/\n if %w(auto_create_users auto_update_users enabled fake_ichain_server keep_standard_login logout_of_ichain_on_logout match_also_by_mail).include? $1\n setting($1) == \"true\"\n else\n super\n end\n else\n super\n end\n end", "def method_missing(method_name, *arguments)\n name = method_name.to_s\n\n if name.chomp!('?')\n self == name\n elsif name.chomp!('!')\n replace(name) unless self == name\n else\n super\n end\n end", "def overrides=(_arg0); end", "def custom; end", "def custom; end", "def method_missing(method, *args, &block)\n return super(method, *args, &block) unless method.to_s =~ /^is_.+\\?$/\n\n self.class.class_eval do\n define_method(method) do |*args, &block|\n false\n end\n end\n\n self.send(method, *args, &block)\n end", "def normal?\n (not wildcard?) and (not absorbent?)\n end", "def overridden_status\n if @override\n @override.downcase.to_sym\n end\n end", "def ignores; end", "def calls_super # :nodoc:\n false\n end", "def generic?; true; end", "def custom?\n @custom\n end", "def wildmask\n super\n end", "def override\n attributes.override\n end", "def specialist_setting\n\tend", "def method_missing(method_name, *args) #:nodoc:\n if @extra_options.has_key? method_name\n @extra_options[method_name]\n else\n super method_name, *args\n end\n end", "def extra; end", "def method_missing(sym, *args, &block)\n return has(sym.to_s.gsub(/\\?/, '')) if sym.to_s =~ /^[a-z_]*\\?$/\n super(sym, *args, &block)\n end", "def extended(*) end", "def method_missing(method, *args, &block)\n method.to_s =~ /^(\\w+)\\?$/ ? !!self[$1] : super\n end", "def special?\n return data.atk_class == 2\n end", "def handle_special_HYPERLINK(special) # rubocop:disable Style/MethodName\n @hyperlink ? special.text : super\n end", "def raw=(bool)\n @raw = (bool ? true : false)\n end", "def flag(name,aliases,desc,long_desc,default_value,arg_name,must_match,type)\n abstract!\n end", "def method_missing(meth, *args, &block)\n if !(meth.to_s =~ /=/) and (suffixed_method = \"#{meth.to_s}__c\") and respond_to?(suffixed_method)\n send(suffixed_method)\n else\n super\n end\n end", "def method_missing(name, *args)\n if name =~ /^is_(\\w+)\\?$/\n return state == $1.upcase\n end\n super\n end", "def ante_options\n (@iron_body_stun_immunity ? [] : [\"ironbody\"]) + super\n end", "def set_special_bin(special_bin)\n @special_bin = special_bin\n end", "def set_defaults\n super\n self.indian_tribe ||= false\n end", "def ignored?()\n #This is a stub, used for indexing\n end", "def attribute_method_with_special_attr?(name)\n name2 = strip_predicate_and_index(name)\n if name2.start_with?('zzz_') && !name2.end_with?('before_type_cast')\n true\n else\n attribute_method_without_special_attr?(name)\n end\n end", "def wp_protect_special_option( option )\n if 'alloptions' == option || 'notoptions' == option\n raise sprintf( '%s is a protected WP option and may not be modified', esc_html(option))\n end\n end", "def respond_to_missing?(*several_variants)\n super\n end", "def is_boolean()\n res = super(context,self)\n return res\n end", "def method_missing(sym, *args, &blk)\n meth = sym.to_s\n if dotruby.respond_to?(sym)\n dotruby.send(sym, *args, &blk)\n else\n name = meth.chomp('=')\n case meth\n when /\\=$/\n dotruby.extra[name.to_s] = args.first\n when /\\!$/\n super(sym, *args)\n else\n if block_given? or args.size > 0\n super(sym, *args)\n else\n dotruby.extra[name.to_s]\n end\n end\n end\n end", "def doi_protection_override!(val=true)\n @doi_protection_override = val\n end", "def limit_custom?\n !self[:custom].nil? && self[:custom] == false\n end", "def override_rights_statement\n %w[true 1].include?(parser.parser_fields['override_rights_statement'].to_s)\n end", "def mixed?\n return false\n end", "def verb\n raise NotImplementedError.new('Must override')\n end", "def inherit_stuff\n return unless accepted_genus\n\n self.classification ||= accepted_genus.classification\n self.lifeform ||= accepted_genus.lifeform\n end", "def method_missing(method, *args, &block)\n super unless original_self\n original_self.send method, *args, &block\n end", "def method_missing(name, *args, &block)\n if name.to_s =~ /\\?$/ && args.empty?\n if @field_variants.any? { |variant| \"#{variant.attribute}?\" == name.to_s }\n 'true'\n else\n 'false'\n end\n else\n super(name.to_sym, *args, &block)\n end\n end", "def cmd_specialty(*args)\n if args.length > 0\n cmd_specialty_help\n return true\n end\n print_line client.exploit.hw_specialty.to_s\n end", "def customize_with_data(data: nil)\n not_implemented(__method__)\n end", "def permissable_options; read_inheritable_attribute(:permissable_options); end", "def current_user\n super || guest_user\n # super = dont change anything, I want the same feature of the method we are overriding\n end", "def setcharup(*)\n super\n end", "def method_missing(m, *args, &block)\n if has? m.to_s\n opt(m.to_s)\n else\n super(m, *args, &block)\n end\n end", "def method_missing(method_name, *args)\n (args && args.size > 0) ? super(method_name, *args) : before_method(method_name)\n end", "def special_action?\n SPECIAL_ACTIONS.include?(action.to_sym)\n end", "def default_interaction\n Whatever\n end", "def conditionally(*) end", "def conditionally(*) end", "def mixed?\n return true\n end", "def standardized?\n is_standard? || standard_copy?\n end", "def tpl_boolean; @original; end", "def call\n\t\tself.apply_overrides\n\t\tyield\n\tensure\n\t\tself.restore_overridden_settings\n\tend", "def call\n\t\tself.apply_overrides\n\t\tyield\n\tensure\n\t\tself.restore_overridden_settings\n\tend", "def respond_to_missing?(*_args); super; end", "def method_missing(method_name, *method_args)\n get(method_name) || super.method_missing(method_name, *method_args)\n end", "def set(value)\n super(value == :true)\n end", "def tag; raise 'Override this method'; end", "def method_missing(name, *args, &_block)\n modifying_method = \"#{name}!\"\n return mutate_clone(modifying_method.to_sym, args) if self.respond_to?(modifying_method)\n super\n end", "def method_missing name, *args, &proc\n underscorized = name.to_s.gsub(/([a-z])([A-Z])/) { \"#{$1}_#{$2}\" }.downcase # make underscored equivilent\n return send(underscorized, *args, &proc) if respond_to? underscorized # translate casing style if we can find an equivilent\n \n read_only = name.to_s.gsub('=', '').to_sym\n if GenericPinMap.has_key? read_only\n if name.to_s.end_with? '='\n return (self[read_only] = args.first)\n else\n return self[read_only]\n end\n end\n \n super # default behaviour\n end", "def standard\n end", "def set_c_like\n\n end", "def super_method; end", "def method_missing(sym, *args)\n\t\t\t\t\tputs \"method_missing: sym = #{sym}\"\n\t\t\t\t\tif sym.to_s =~ /to_ferret$/ then\n\t\t\t\t\t\tputs \"************************** REJECTED **************************\"\n\t\t\t\t\t\treturn \"\"\n\t\t\t\t\telse\n\t\t\t\t\t\tsuper(sym, *args)\n\t\t\t\t\tend\n\t\t\t\tend", "def defaults\n self.behaviour_evaluated = false if self.behaviour_evaluated.nil?\n self.special_needs_ok = false if self.special_needs_ok.nil?\n self.long_term_resident = false if self.long_term_resident.nil?\n self.senior = false if self.senior.nil?\n end", "def test?\n @options[:test] || super\n end", "def test?\n @options[:test] || super\n end", "def set_additional_values(object, override)\n override.class.attributes.each do |o|\n object.instance_variable_set(\"@#{o}\", override[o])\n object.define_singleton_method(o.to_sym) { instance_variable_get(\"@#{o}\") }\n end\n end", "def inherited(base); end", "def extra=(_arg0); end", "def normalize_options\n if @opts[:disabled] == false\n super\n else\n super\n @attr[:disabled] = :disabled\n end\n end", "def method_missing(symbol, *args, &block)\n if @options.key?(symbol)\n @options[symbol]\n else\n super(symbol, *args, &block)\n end\n end", "def method_missing(meth, *args)\n v = Variation.find_by_name meth.to_s\n if v\n product_variations.variation_is(v).first\n else\n super\n end\n end", "def special(txt, sub)\n raise 'not implemented'\n end", "def respond_to?(name)\n string_name = name.to_s\n return true if string_name =~ /^replace_\\w+/\n super\nend", "def normal\n end", "def normal\n end", "def important?(word)\n\nend", "def qwerty\n\t\tfalse\n\tend", "def original; end", "def source(override); end", "def enabled=(_arg0); end", "def enabled=(_arg0); end", "def enabled=(_arg0); end", "def enabled=(_arg0); end", "def enabled=(_arg0); end" ]
[ "0.71309096", "0.6226058", "0.61120033", "0.59751964", "0.5869382", "0.5725025", "0.5698278", "0.56727046", "0.56639534", "0.5553868", "0.5505519", "0.5494788", "0.54832375", "0.54832375", "0.5450311", "0.5423534", "0.5421569", "0.5414391", "0.5395716", "0.53858036", "0.5371852", "0.5346709", "0.5323747", "0.5321829", "0.5319616", "0.5294958", "0.5291745", "0.52694154", "0.52438986", "0.52200687", "0.5195497", "0.51781714", "0.51681614", "0.5158893", "0.51557547", "0.515459", "0.51533043", "0.5142917", "0.5141553", "0.51018673", "0.5095068", "0.5091863", "0.50850344", "0.50735897", "0.505866", "0.50540525", "0.5050157", "0.5049685", "0.5037992", "0.50289506", "0.501964", "0.5015117", "0.5010919", "0.49789318", "0.4977512", "0.49735647", "0.49699366", "0.49673635", "0.49651343", "0.49648005", "0.4963447", "0.49581483", "0.49581483", "0.4956234", "0.4945698", "0.49451774", "0.4944965", "0.4944965", "0.49424303", "0.49398342", "0.49305883", "0.49285382", "0.49256223", "0.49200565", "0.4919685", "0.4919553", "0.49112183", "0.49081913", "0.4906872", "0.4900412", "0.4900412", "0.49003223", "0.48974407", "0.4894559", "0.4889995", "0.48872298", "0.4883579", "0.48832753", "0.4882167", "0.4881102", "0.4881102", "0.4880307", "0.4864406", "0.48565194", "0.48520213", "0.4850583", "0.4850583", "0.4850583", "0.4850583", "0.4850583" ]
0.8336799
0
Initialize an instance of Issue
def initialize(attributes = {}) @project_id = attributes.fetch(:project_id) { raise ArgumentError, "Missing project_id" } @title = attributes.fetch(:title) { raise ArgumentError, "Missing title" } @description = attributes.fetch(:body) { raise ArgumentError, "Missing description" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(issue_id=nil)\n @issue =\n if issue_id\n Issue.find(issue_id)\n else\n Issue.new\n end\n end", "def build_issue\n @issue = Issue.new\n end", "def initialize(jira, issue)\n @jira = jira\n @issue = issue\n end", "def initialize(issue, project, client)\n @issue = issue\n @project = project\n @client = client\n end", "def initialize(params)\n params.each do |key, value| \n instance_variable_set(\"@#{key}\", value) if Issue.instance_methods.include? key\n end\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.serviceHealthIssue\"\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def initialize(options)\n self.token = options[:token]\n self.request = options[:request]\n self.exception_data = options[:exception_data]\n self.organization = options[:organization]\n self.repo = options[:repo]\n self.issue_options = options[:issue_options]\n self.project = nil\n self.column_id = nil \n end", "def issue_importer\n @issue_importer ||= IssueImporter.new(github_client)\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find(params[:id])\n end", "def issue_updater\n @issue_updater ||= IssueUpdater.new(github_client)\n end", "def initialize(bug)\n @bug = bug\n end", "def issue\n @issue ||= Issue.get_for_commit(message)\n end", "def set_issue\n id = params[:id].present? ? params[:id] : params[:issue_id] \n @issue = Issue.find(id)\n end", "def initialize\n @id = \"_\" + UUID.new.generate\n @version = \"2.0\"\n @issue_instant = Time.now.utc\n end", "def initialize(org:, repo:, issue_number: nil)\n @org = org\n @repo = repo\n @issue_number = issue_number\n\n opts =\n if issue_number.present?\n { issue_number: issue_number }\n else\n {}\n end\n\n super() do |i|\n Cooldowner.with_cooldown do\n Hubkit.client.issues.events.list(\n @org,\n @repo,\n opts.merge(page: i),\n )\n end\n end\n end", "def set_issue\n @project = Project.find(params[:project_id])\n @issue = @project.issues.find(params[:id])\n end", "def create_issue\n logger.info \"Creating new issue in project #{project.jira_project}: #{pull_request.title}\"\n\n jira_issue = PuppetLabs::Jira::Issue.build(client, project)\n fields = PuppetLabs::Jira::Formatter.format_pull_request(pull_request)\n\n jira_issue.create(fields[:summary], fields[:description])\n link_issue(jira_issue)\n\n logger.info \"Created jira issue with webhook-id #{pull_request.identifier}\"\n rescue PuppetLabs::Jira::APIError => e\n logger.error \"Failed to save #{pull_request.title}: #{e.message}\"\n end", "def initialize(pull_request, project, client)\n @pull_request = pull_request\n @project = project\n @client = client\n @user_finder = UserFinder.new(project, client)\n @milestone_finder = MilestoneFinder.new(project)\n @issuable_finder =\n GithubImport::IssuableFinder.new(project, pull_request)\n end", "def set_project_issue\n @project_issue = ProjectIssue.find(params[:id])\n end", "def issue\n @issue ||= Gitmine::Issue.get_for_commit(message)\n end", "def initialize(context)\n super()\n @context = Hashie::Mash.new(context)\n @repository_info = @context.repository\n pull_request_info = @context.pull_request\n @event_created_at = pull_request_info.try(:created_at)\n @event_user_info = pull_request_info.try(:user)\n @commit_info = pull_request_info.try(:commits)\n end", "def initialize\n initialize!\n end", "def initialize\n initialize!\n end", "def initialize(pull_request, project, client)\n @pull_request = pull_request\n @project = project\n @client = client\n @user_finder = GithubImport::UserFinder.new(project, client)\n @milestone_finder = MilestoneFinder.new(project)\n @issuable_finder =\n GithubImport::IssuableFinder.new(project, pull_request)\n end", "def issue\n @issue = Issue.find(params[:id])\n end", "def set_issue\n @issue = Issue.find_by(id: params[:id])\n render json: {error: 'Issue not found'}, status: :not_found if @issue.nil?\n end", "def initialize issue_code, *args, &block\n @issue_code = issue_code\n @message_block = block\n @arg_names = args\n @demotable = true\n end", "def init\n raise NotImplementedError\n end", "def set_issue\n @issue = Issue.find(params[:id])\n @retro = Retro.find(@issue.retro_id)\n end", "def initialize(cause:)\n super\n\n self.cause = cause\n end", "def set_issue\n @issue = current_user.issues.find(params[:id])\n end", "def create\n @issue = Issue.new(issue_params)\n @issue.status=\"Open\"\n @issue.resolution=\"\"\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render action: 'show', status: :created, location: @issue }\n else\n format.html { render action: 'new' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @issue = Issue.new(issue_params)\n @issue.userCreator = current_user.id\n @issue.idUserAssignee = current_user.id\n @issue.votes = 0\n @issue.creationDate = Time.now\n @issue.updated = Time.now\n @issue.status = 'NEW'\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @issue = Issue.new\n @issue.copy_from(params[:copy_from]) if params[:copy_from]\n @issue.project = @project\n @issue.user_story_id = params[:user_story_id] unless params[:user_story_id].blank? \n # Tracker must be set before custom field values\n @issue.tracker ||= @project.trackers.find((params[:issue] && params[:issue][:tracker_id]) || params[:tracker_id] || :first)\n if @issue.tracker.nil?\n render_error l(:error_no_tracker_in_project)\n return\n end\n if params[:issue].is_a?(Hash)\n @issue.attributes = params[:issue]\n @issue.watcher_user_ids = params[:issue]['watcher_user_ids'] if User.current.allowed_to?(:add_issue_watchers, @project)\n end\n @issue.author = User.current\n\n default_status = IssueStatus.default\n unless default_status\n render_error l(:error_no_default_issue_status)\n return\n end\n @issue.status = default_status\n @allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.roles_for_project(@project), @issue.tracker)).uniq\n\n if request.get? || request.post? && !params[:reload].blank?\n @issue.start_date ||= Date.today\n @priorities = IssuePriority.all\n render :partial => \"issue_sprints/new\"\n else\n requested_status = IssueStatus.find_by_id(params[:issue][:status_id])\n # Check that the user is allowed to apply the requested status\n @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status\n @issue.fixed_version_id = @issue.user_story.version_id\n if @issue.save\n status = done_ratio_to_status(@issue)\n attach_files(@issue, params[:attachments])\n call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})\n @issue_statuses = IssueStatus.find(:all)\n @project_users = User.find(:all, :joins => :members, :conditions => [\"members.project_id = ?\", @project.id])\n render :update do |p|\n p.insert_html :bottom, \"tasks_#{status}_us_#{@issue.user_story_id}\", :partial => \"shared/task_view\",\n :locals => {:task => @issue, :issue_statuses => @issue_statuses,\n :project_users => @project_users}\n end\n return\n end\n end\n end", "def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end", "def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end", "def initialize # rubocop:disable Lint/UselessMethodDefinition\n super()\n end", "def set_jira_issue\n @jira_issue = JiraIssue.find(params[:id])\n end", "def create\n @issue = @issuable.issues.new(params[:issue])\n\n respond_to do |format|\n if @issue.save\n track_activity(@issuable, 'open', nil, @issue)\n format.html { redirect_to [@issuable, @issue], notice: 'Issue was successfully created.' }\n format.json { render json: @issue, status: :created, location: @issue }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize\n create_new_rep\n end", "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to issues_url, notice: 'Issue was successfully created.' }\n format.json { render json: @issue }\n else\n format.html { redirect_to issues_url, notice: 'There was a problem saving your issue. Do you need a tissue?' }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize()\n raise \"#{self.class.to_s} should not be instantiated directly.\"\n end", "def initialize\n init\n end", "def initialize(work_options={})\n \n @id = work_options[\"id\"]\n @name = work_options[\"name\"]\n @assignmentlink = work_options[\"assignmentlink\"]\n @contributor_id = work_options[\"contributor_id\"]\n end", "def initialize(details)\n @details = details\n @error = nil\n end", "def new_issue(type)\n login\n title = ask(\"Title\")\n description = ask(\"Description\")\n create_ticket(type, title, description, $config[\"user\"], $config[\"project\"], $config[\"component\"])\n end", "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render :show, status: :created, location: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @issue = Issue.new(params[:issue])\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to @issue, notice: 'Issue was successfully created.' }\n format.json { render json: @issue, status: :created, location: @issue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize\n end", "def perform\n # labels option cannot be null due to https://github.com/octokit/octokit.rb/pull/538\n result = GitHub.create_issue(repo_name, title, body, labels: [])\n # capture the information\n self.number = result.number\n self.data = result\n rescue => e\n raise CannotCreate, e.message\n end", "def initialize repo, log, process, type\n @repo, @log, @process, @type = repo, log, process, type\n end", "def new_issue(issue)\n @issue = issue\n\n mail subject: \"New Issue Ticket\"\n end", "def create\n @issue = Issue.new(issue_params)\n\n respond_to do |format|\n if @issue.save\n format.html { redirect_to :success, notice: 'Issue was successfully created.' }\n format.json { render json: @issue }\n else\n format.html { render :new }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "def issue_obj(hash)\n f = hash[:fields]\n\n # NOTE: Order is important here!\n obj = {\n key: hash['key'],\n priority: f[:priority] ? f[:priority][:name] : '-',\n summary: f[:summary],\n description: f[:description],\n type: f[:issuetype][:name],\n created: Time.parse(f[:created]).strftime('%b %d'),\n status: f[:status] ? f[:status][:name] : 'Open',\n assignee: f[:assignee][:displayName],\n reporter: f[:reporter][:displayName],\n comments: f[:comment],\n labels: f[:labels],\n }\n\n # Additional formatting\n obj[:priority] = print_priority(obj[:priority])\n obj[:status] = print_status(obj[:status])\n\n obj\n rescue => err\n error_message(err)\n end", "def create\n @item = Issue.find_by_url(params[:issue_url])\n\n if @item\n response.status = :ok\n else\n # Find or create Tracker\n tracker = Tracker.find_by_url(params[:project_url])\n tracker ||= Tracker.create!(\n url: params[:project_url],\n name: params[:project_name]\n )\n\n @item = tracker.issues.create!(\n url: params[:issue_url],\n title: params[:title],\n number: params[:number]\n )\n\n response.status = :created\n end\n\n render 'api/v2/issues/show'\n end", "def set_git_hub_issue\n @git_hub_issue = GitHubIssue.find(params[:id])\n end", "def can_create_issue\n issue = Issue.new(issue_attributes)\n issue.author = self.author\n issue.parent_issue_id = self.parent_issue_id\n issue.allow_to_create_in_closed_structure = true if Redmine::Plugin.all.map(&:id).include?(:redmine_closed_issues_structure)\n unless issue.valid?\n copy_errors_from(issue)\n end\n end", "def create\n @base_issue = BaseIssue.new(params[:base_issue])\n\n respond_to do |format|\n if @base_issue.save\n format.html { redirect_to @base_issue, :notice => 'Base issue was successfully created.' }\n format.json { render :json => @base_issue, :status => :created, :location => @base_issue }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @base_issue.errors, :status => :unprocessable_entity }\n end\n end\n end", "def initialize(env)\n @reference = generate_error_reference\n extract_information_from(env)\n end", "def new_issue(title)\n result = YAML.load(RestClient.post(\"https://github.com/api/v2/yaml/issues/open/#{@repository}\", :login => @username,\n :token => @api_token, :title => title))\n result[\"issue\"][\"number\"]\n end", "def set_local_issue\n @local_issue = LocalIssue.find(params[:id])\n end", "def set_issue_type\n @issue_type = IssueType.find(params[:id])\n end", "def set_issue_type\n @issue_type = IssueType.find(params[:id])\n end", "def addIssue(issue)\n @issues << issue if issue\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize()\n end", "def initialize(repo, msg, act=nil)\n @repo = repo\n @message = msg\n @actor = act\n end", "def initialize(context)\n super()\n @context = Hashie::Mash.new(context)\n @repository_info = @context.repository\n release_request_info = @context.release\n @event_created_at = @context.released_at\n @event_user_info = release_request_info.try(:author)\n @release_tag = release_request_info.try(:tag_name)\n @release_application_id = release_request_info.try(:id)\n @commit_info = release_request_info.try(:commits)\n @created_commits = Commit.none\n @release = Release.new\n end", "def initialize(branch_type, pull_request_id, options={})\n self.branch_type = branch_type\n self.pull_request_id = pull_request_id\n self.options = options\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end", "def initialize\n end" ]
[ "0.80681145", "0.79213995", "0.77904505", "0.7358495", "0.72131765", "0.66923636", "0.6653379", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.6606198", "0.65644956", "0.6562318", "0.65583515", "0.65583515", "0.65583515", "0.65583515", "0.65337855", "0.648122", "0.646427", "0.64304686", "0.6422475", "0.64150214", "0.6377895", "0.6367029", "0.61697185", "0.61513484", "0.61223614", "0.61167634", "0.6104672", "0.6104672", "0.609485", "0.6070051", "0.6063059", "0.60203075", "0.60153556", "0.599874", "0.59965044", "0.59818125", "0.59745175", "0.5968897", "0.5967534", "0.59602755", "0.59602755", "0.59602755", "0.59449804", "0.5938142", "0.59375274", "0.5917203", "0.5905938", "0.58985233", "0.5895676", "0.58881813", "0.5876324", "0.5865533", "0.5865533", "0.5865533", "0.5865533", "0.58614355", "0.585422", "0.58536106", "0.58515835", "0.5831863", "0.58307254", "0.5824262", "0.58123165", "0.58105105", "0.58004266", "0.5798358", "0.57978946", "0.5791537", "0.57839656", "0.57676005", "0.57676005", "0.5765384", "0.5763262", "0.5763262", "0.5763262", "0.5763262", "0.5763262", "0.5763262", "0.5763043", "0.57629204", "0.57380974", "0.57256114", "0.57196116", "0.57196116", "0.57196116", "0.57196116", "0.57196116", "0.57196116" ]
0.0
-1
Delete VPC. ec2.delete_vpc("vpc890ce2e0") => true
def delete_vpc(vpc_id) link = generate_request("DeleteVpc", 'VpcId' => vpc_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n requires :id\n service.delete_vpc(id)\n true\n end", "def delete_vpc(vpc_id)\n return if vpc_id.nil? || !configured?\n\n @client.delete_vpc(vpc_id: vpc_id)\n end", "def destroy\n @aws_vpc_tag.destroy\n respond_to do |format|\n format.html { redirect_to aws_vpc_tags_url, notice: 'Aws vpc tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_vpc_by_config_id(configuration_id)\n return if configuration_id.nil? || !configured?\n\n vpc = get_vpc_by_config_id(configuration_id)\n delete_vpc(vpc[:vpc_id]) unless vpc.nil?\n end", "def destroy \n ec2 = self.class.new_ec2(@resource.value(:user), @resource.value(:password))\n ec2.terminate_instances({:instance_id => @property_hash[:instance_id]})\n ec2.delete_security_group({:group_name => @resource.value(:name)})\n end", "def deletevolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{@thevolume.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n end", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def delete(resource_group_name, public_ip_name)\n OOLog.info(\"Deleting public IP '#{public_ip_name}' from '#{resource_group_name}' \")\n start_time = Time.now.to_i\n begin\n public_ip_exists = @network_client.public_ips.check_public_ip_exists(resource_group_name, public_ip_name)\n if !public_ip_exists\n OOLog.info(\"The Public IP #{public_ip_name} does not exist. Moving on...\")\n result = nil\n else\n public_ip = @network_client.public_ips.get(resource_group_name, public_ip_name)\n result = !public_ip.nil? ? public_ip.destroy : Chef::Log.info('AzureNetwork::PublicIp - 404 code, trying to delete something that is not there.')\n end\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.body}\")\n rescue => e\n OOLog.fatal(\"Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.message}\")\n end\n end_time = Time.now.to_i\n duration = end_time - start_time\n OOLog.info(\"operation took #{duration} seconds\")\n result\n end", "def key_pair_deleted?(ec2_client, key_pair_name)\n ec2_client.delete_key_pair(key_name: key_pair_name)\n return true\nrescue StandardError => e\n puts \"Error deleting key pair: #{e.message}\"\n return false\nend", "def destroy\n requires :vpn_connection_id\n\n service.delete_vpn_connection(vpn_connection_id)\n true\n end", "def delete_address(name,region)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_address(name,region)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def destroy\n @ec2_instance.destroy\n respond_to do |format|\n format.html { redirect_to ec2_instances_url, notice: 'Ec2 instance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end", "def removed_vpc_ids\n @aws.vpc - @local.vpc\n end", "def detach(vpc_id)\n requires :id\n service.detach_internet_gateway(id, vpc_id)\n reload\n end", "def destroy!\n response = @connection.dbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/instances/#{CloudDB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def destroy\n @aws_elastic_ip.destroy\n respond_to do |format|\n format.html { redirect_to aws_elastic_ips_url, notice: 'Aws elastic ip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @capd = Capd.find(params[:id])\n @capd.destroy\n\n respond_to do |format|\n format.html { redirect_to(capds_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @pc_region = PcRegion.find(params[:id])\n @pc_region.destroy\n\n respond_to do |format|\n format.html { redirect_to pc_regions_url }\n format.json { head :ok }\n end\n end", "def destroy\n @aws_certificate.destroy\n respond_to do |format|\n format.html { redirect_to aws_certificates_url, notice: 'Aws certificate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy(name, &each_group)\n list(name, &each_group) if each_group\n ret = @@ec2.delete_security_group(:group_name => name)\n (ret && ret['return'] == 'true')\n end", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def deletesecuritygroup\n if not checkRequirements([\"thezone\",\"thefirewall\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/global/firewalls/#{@thefirewall.serial}', :method => 'delete', :options => '', :acces_token => @thezone.token )\n checkQuery(:type => 'global', :token => @thezone.token, :projectname => @thezone.name, :operationname => submit[\"name\"])\n end", "def destroy\n @card_ip.destroy\n end", "def remove_vpc_properties\n properties = []\n properties << :InstanceTenancy\n properties << :Tags\n add_patch Patches::RemoveProperty.new 'AWS::EC2::VPC', properties\n end", "def vpc_id\n data[:vpc_id]\n end", "def vpc_id\n data[:vpc_id]\n end", "def vpc_id\n data[:vpc_id]\n end", "def vpc_id\n data[:vpc_id]\n end", "def del_ip(vid, ip_address)\n perform_request(:action => 'vserver-delip', :vserverid => vid, :ipaddr => ip_address)\n end", "def destroy\n destroy!\n rescue AnsibleTowerClient::Error\n false\n end", "def del_ip(vid, ip_address)\n perform_request(action: 'vserver-delip', vserverid: vid, ipaddr: ip_address)\n end", "def destroy!\n response = @connection.dbreq(\"DELETE\",@dbmgmthost,\"#{@dbmgmtpath}/instances/#{CloudDB.escape(@instance.id.to_s)}/databases/#{CloudDB.escape(@name.to_s)}\",@dbmgmtport,@dbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n true\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def destroy\n @aws_subnet.destroy\n respond_to do |format|\n format.html { redirect_to aws_subnets_url, notice: 'Aws subnet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n ensure_service!\n service.delete_backup instance_id, backup_id\n true\n end", "def destroy\n @aws_az.destroy\n respond_to do |format|\n format.html { redirect_to aws_azs_url, notice: 'Aws az was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @tag_cloud = TagCloud.find(params[:id])\r\n @tag_cloud.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(tag_clouds_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "def destroy\n @gce_region.destroy\n respond_to do |format|\n format.html { redirect_to gce_regions_url, notice: 'Gce region was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n requires :id\n service.delete_dhcp_options(id)\n true\n end", "def vpc_id\n data.vpc_id\n end", "def vpc_id\n data.vpc_id\n end", "def destroy(stack)\n return unless stack?(name)\n\n # delete the cloudformation stack\n info \"deleting the cloudformation stack: #{stack}\"\n client.delete_stack stack_name: stack\n # wait for the deletion to finish\n cloudformation.wait_until :stack_delete_complete, stack_name: stack\n # check the status of the result\n end", "def destroy\n @aws_dhcp_option_attribute.destroy\n respond_to do |format|\n format.html { redirect_to aws_dhcp_option_attributes_url, notice: 'Aws dhcp option attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_instance(instance_name)\n return if !configured? || !instance_exists?(instance_name)\n\n @service.delete_instance(@gcp_config['project'], @gcp_config['zone'], instance_name)\n rescue StandardError => e\n @logger.error(e.message)\n end", "def terminateinstances\n if not checkRequirements([\"thezone\",\"theserver\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@theserver.azone.name}/instances/#{@theserver.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @theserver.azone.name, :operationname => submit[\"name\"] )\n end", "def delete_instance_profile(instance_profile_name)\n request(\n 'Action' => 'DeleteInstanceProfile',\n 'InstanceProfileName' => instance_profile_name,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "def delete_secGrp(groupName,vpc=nil)\n start = @serverBranch if vpc == nil or vpc == \"\"\n start = @vpc_serverBranch[vpc] if vpc != nil and vpc != \"\"\n t = @tree.findItem(groupName,start)\n if t != nil\n p = t.parent\n if p != nil\n if (p.text() == \"Servers\" and (vpc == nil or vpc == \"\")) or\n ((vpc != nil and vpc != \"\") and p.text() == vpc)\n @tree.removeItem(t)\n end\n else\n puts \"Security Group not found in tree\"\n end\n else\n puts \"Security Group not found in tree\"\n end\n end", "def destroy\n @ip = AllowedIpAddress.find(params[:id])\n @ip.destroy\n\n respond_to do |format|\n flash[:notice] = 'Allowed IP Address was successfully deleted.'\n format.html { redirect_to allowed_ip_address_path }\n format.xml { head :ok }\n end\n end", "def bucket_policy_deleted?(s3_client, bucket_name)\r\n s3_client.delete_bucket_policy(bucket: bucket_name)\r\n return true\r\nrescue StandardError => e\r\n puts \"Error deleting bucket policy: #{e.message}\"\r\n return false\r\nend", "def destroy!\n response = @connection.lbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def destroy\n @capacidad.destroy\n respond_to do |format|\n format.html { redirect_to capacidads_url, notice: 'Capacidad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @aws_security_group_egress.destroy\n respond_to do |format|\n format.html { redirect_to aws_security_group_egresses_url, notice: 'Aws security group egress was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @dns_zone = DnsZone.find(params[:id])\n @dns_zone.destroy\n\n respond_to do |format|\n format.html { redirect_to(dns_zones_url) }\n format.xml { head :ok }\n end\n end", "def delete options = {}\n ensure_connection!\n resp = connection.delete_bucket name, options\n if resp.success?\n true\n else\n ApiError.from_response(resp)\n end\n end", "def delete_key_pair(name)\n delete(\"tenants/#{tenant}/sshkeys/#{name}\")\n end", "def destroy\n @auth_ip_address_group.destroy\n head :no_content\n end", "def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end", "def delete_key_pair\n @os_aws.delete_key_pair\n end", "def delete()\n\n client.delete(\"/tags/#{gid}\") && true\n end", "def delete_hosted_zone(zone_id)\n # AWS methods return zone_ids that looks like '/hostedzone/id'. Let the caller either use\n # that form or just the actual id (which is what this request needs)\n zone_id = zone_id.sub('/hostedzone/', '')\n\n request({\n :expects => 200,\n :parser => Fog::Parsers::AWS::DNS::DeleteHostedZone.new,\n :method => 'DELETE',\n :path => \"hostedzone/#{zone_id}\"\n })\n end", "def destroy\n @vip = Vip.find(params[:id])\n @vip.destroy\n\n respond_to do |format|\n format.html { redirect_to(vips_url) }\n format.xml { head :ok }\n end\n end", "def delete_cors\n @bucket_cors.delete\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't delete CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end", "def delete request_pb, options:, &block\n request_json = JSON.parse ::Google::Cloud::Compute::V1::DeleteSecurityPolicyRequest.encode_json(request_pb)\n\n uri = \"/compute/v1/projects/#{request_pb.project}/global/securityPolicies/#{request_pb.security_policy}\"\n\n result_json = @client_stub.make_delete_request(\n uri: uri,\n options: options,\n &block\n )\n\n ::Google::Cloud::Compute::V1::Operation.decode_json result_json[:body], { ignore_unknown_fields: true }\n end", "def delete!(cidr)\n removed = false\n\n # validate object\n if ( !cidr.kind_of?(NetAddr::CIDR) )\n begin\n cidr = NetAddr::CIDR.create(cidr)\n rescue Exception => error\n raise ArgumentError, \"Provided argument raised the following \" +\n \"errors: #{error}\"\n end\n end\n\n # find matching\n me = find_me(cidr)\n\n # remove\n if (me)\n parent = me.tag[:Parent]\n children = me.tag[:Subnets]\n parent.tag[:Subnets].delete(me)\n children.each {|x| add_to_parent(x,parent)}\n removed = true\n end\n\n return(removed)\n end", "def destroy_kvm(kvm_name)\n [\n \"virsh destroy #{kvm_name}\",\n \"virsh undefine #{kvm_name}\"\n ].each do |cmd|\n raise \"Failed to delete node: #{kvm_name}\" unless system(cmd)\n end\n File.delete(File.join(KVM_HOME, 'storage', \"#{kvm_name}.qcow2\"))\nend", "def destroy\n\n authorize @cov_pdp\n @city = City.find(@cov_pdp.city.id)\n @city.cov_pdp_count -= @cov_pdp.amount\n @city.save\n\n @cov_pdp.destroy\n respond_to do |format|\n format.html { redirect_to cov_pdps_url, notice: 'Cov pdp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_image(image_id)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n data = conn.delete_image(image_id)\n if data.status == 200\n data = true\n else\n data = false\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def delete_vcenter(vcenter_id=nil, auth=nil, cert=nil)\n check_vcenter(vcenter_id)\n payload = {\n }.to_json\n rest_post(payload, \"#{@base_url}/compute/vcenters/#{vcenter_id}/deactivate\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n end", "def bucket_deleted?(s3_client, bucket_name)\r\n s3_client.delete_bucket(bucket: bucket_name)\r\n return true\r\nrescue StandardError => e\r\n puts \"Error deleting bucket: #{e.message}\"\r\n return false\r\nend", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete_policy_EC2\n $iam.client.delete_role_policy(\n :role_name => 'ec2-start-stop',\n :policy_name => 'ec2-start-stop')\n \n redirect_to iams_path, notice: 'Deleted Role: ec2-start-stop' \n end", "def destroy\n @region = RegionTemplate.find(params[:id])\n @region.destroy\n\n respond_to do |format|\n format.html { redirect_to(region_templates_url) }\n format.xml { head :ok }\n end\n end", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def delete!\n response = @compute.connection.csreq(\"DELETE\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}\",@svrmgmtport,@svrmgmtscheme)\n OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "def vpc_params\n params.fetch(:vpc, {})\n end", "def openvz_fog_test_server_destroy\n server = openvz_service.servers.find { |s| s.ctid == '104' }\n server.destroy if server\nend", "def destroy(state)\n return if state[:vm_name].nil?\n\n # Reset resource pool, as it's not needed for the destroy action but might be a remnant of earlier calls to \"connect\"\n # Temporary fix until setting cluster + resource_pool at the same time is implemented (lines #64/#187)\n config[:resource_pool] = nil\n\n save_and_validate_parameters\n connect\n\n vm = get_vm(state[:vm_name])\n unless vm.nil?\n vm_api = VSphereAutomation::VCenter::VMApi.new(api_client)\n raise_if_unauthenticated vm_api, \"connecting to VM API\"\n\n # shut the machine down if it is running\n if vm.power_state == \"POWERED_ON\"\n power = VSphereAutomation::VCenter::VmPowerApi.new(api_client)\n power.stop(vm.vm)\n end\n\n # delete the vm\n vm_api.delete(vm.vm)\n end\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id}):v2\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id) if @stemcell_api_version < 2\n end\n end\n end", "def destroy\n @cp3.destroy\n respond_to do |format|\n format.html { redirect_to cp3s_url }\n format.json { head :no_content }\n end\n end", "def delete_pokemon(withdraw = true, party = $pokemon_party)\n r = execute('deletePokemon', id: party.online_id, withdraw: withdraw ? 'y' : 'n')\n ret = r == 'success'\n log_error(r) unless ret\n return ret\n end", "def destroy\n @capacitacion = Capacitacion.find(params[:id])\n @capacitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to capacitacions_url }\n format.json { head :no_content }\n end\n end", "def delete\n ensure_service!\n service.delete_cluster(instance_id, cluster_id)\n true\n end", "def delete(name)\n r = request('DeleteTemplate', { :name => name })\n return r['status'] == ' ok ' \n end", "def delete_cluster instance_id, cluster_id\n execute do\n instances.delete_cluster(\n cluster_path(instance_id, cluster_id)\n )\n end\n end", "def destroy(state)\n return if state[:vm_name].nil?\n\n save_and_validate_parameters\n connect\n vm = get_vm(state[:vm_name])\n\n vm_obj = Com::Vmware::Vcenter::VM.new(vapi_config)\n\n # shut the machine down if it is running\n if vm.power_state.value == \"POWERED_ON\"\n power = Com::Vmware::Vcenter::Vm::Power.new(vapi_config)\n power.stop(vm.vm)\n end\n\n # delete the vm\n vm_obj.delete(vm.vm)\n end", "def delete_disk(name, zone_name)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_disk(name, zone_name)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def delete_policy\n\n group = $iam.groups[params[:name]]\n\n AWS.config(\n :access_key_id => ENV[\"S3_ACCESS_KEY\"], \n :secret_access_key => ENV[\"S3_SECRET_KEY\"])\n\n policy_name = 's3-read-write' \n\n $iam.client.delete_group_policy(\n :group_name => group.name,\n :policy_name => policy_name)\n\n redirect_to \"/show_group/#{group.name}\", notice: 'Deleted s3-read-write policy from the Group'\n \n end", "def destroy\n @vip_privilege.destroy\n respond_to do |format|\n format.html { redirect_to vip_privileges_url }\n format.json { head :no_content }\n end\n end", "def delete\n execute_prlctl('delete', @uuid)\n end", "def destroy\n @ip_address.destroy\n respond_to do |format|\n format.html { redirect_to ip_addresses_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @capacidad = Capacidad.find(params[:id])\n @capacidad.destroy\n\n respond_to do |format|\n format.html { redirect_to capacidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pdk.destroy\n respond_to do |format|\n format.html { redirect_to pdks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n audit(@service_template, \"destroy\", @service_template.name)\n authorize @service_template\n\n @service_template.destroy\n respond_to do |format|\n format.html { redirect_to service_templates_url, notice: 'Service template was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_snapshot(snapshot_id)\n log \"\\e[0;31m:: Deleting snapshot:\\e[0m #{snapshot_id}\"\n\n begin\n ec2.delete_snapshot(snapshot_id)\n sleep 0.2\n rescue Fog::Compute::AWS::NotFound\n log \"Failed to delete snapshot: #{snapshot_id}; setting { 'protected' => true }\"\n ec2.tags.create({resource_id: snapshot_id, key: 'protected', value: 'true'})\n rescue Fog::Compute::AWS::Error\n log \"API Error\"\n end\n\n end", "def destroy\n resources = find_resources_by_tag\n\n destroy_instance(resources)\n destroy_security_group(resources)\n destroy_subnet(resources)\n destroy_route_table(resources)\n\n nil\n end", "def destroy_instance(instance)\n tenant = @identity.find_tenant(instance.tenant_id)\n fog_options = @fog_options[:storage].merge(:hp_tenant_id => tenant.id)\n\n storage = VCAP::Services::Swift::Storage.new(@logger, fog_options)\n storage.delete_account\n\n @logger.debug \"Account meta data (should be 'Recently deleted'): \" + storage.get_account_meta_data.body.to_s\n\n @identity.delete_users_by_tenant_id(instance.tenant_id, @fog_options[:name_suffix])\n @identity.delete_tenant(instance.tenant_id)\n raise SwiftError.new(SwiftError::SWIFT_DESTROY_INSTANCE_FAILED, instance.inspect) unless instance.destroy\n end", "def destroy\n @csp.destroy\n respond_to do |format|\n format.html { redirect_to csps_url, notice: 'Csp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def vpc\n q = []\n\n # vpc node\n q.push(_upsert({ node: 'AWS_VPC', id: @name }))\n end", "def destroy key_name\n params = {\n \"KeyName\" => key_name\n }\n\n response = @client.action \"DeleteKeyPair\", params\n\n Response::Return.new response.body['DeleteKeyPairResponse']\n end" ]
[ "0.8224563", "0.790087", "0.694757", "0.6551244", "0.63807094", "0.6149625", "0.6077866", "0.5724397", "0.5701135", "0.5694534", "0.5691916", "0.56865984", "0.56732345", "0.56375486", "0.56126297", "0.5608507", "0.5586136", "0.55807585", "0.5557539", "0.55503654", "0.55220866", "0.5521505", "0.5491313", "0.5478986", "0.54784733", "0.5473395", "0.5473395", "0.5473395", "0.5473395", "0.5469703", "0.5467552", "0.5447839", "0.54410416", "0.5431582", "0.54088", "0.54058045", "0.5377971", "0.5377704", "0.5368243", "0.53482777", "0.5342436", "0.5340894", "0.5332397", "0.5312757", "0.53050786", "0.52960646", "0.52835846", "0.5282103", "0.52747124", "0.5255997", "0.5251001", "0.5250141", "0.52191985", "0.5218666", "0.5217868", "0.5215484", "0.5203743", "0.51927805", "0.5191363", "0.5160772", "0.5159542", "0.5147256", "0.51418465", "0.51344895", "0.5130581", "0.5121088", "0.5120312", "0.5118459", "0.5094019", "0.5091779", "0.5090514", "0.5089852", "0.50860655", "0.50847834", "0.5084233", "0.5083212", "0.5082475", "0.5080995", "0.5078259", "0.5071949", "0.50674206", "0.506587", "0.5063941", "0.50587535", "0.5057321", "0.50567704", "0.5055646", "0.50535214", "0.50513506", "0.50455534", "0.50428176", "0.5042151", "0.50415397", "0.50415313", "0.50354487", "0.5034131", "0.50328296", "0.5030945", "0.5029217", "0.50282824" ]
0.7932706
1
Delete Subnet. ec2.delete_subnet("subnet770de31e") => true
def delete_subnet(subnet_id) link = generate_request("DeleteSubnet", 'SubnetId' => subnet_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n requires :subnet_id\n\n service.delete_subnet(subnet_id)\n true\n end", "def delete_subnet(subnet)\n return delete_request(address(\"subnets/\" + subnet), @token)\n end", "def destroy\n @aws_subnet.destroy\n respond_to do |format|\n format.html { redirect_to aws_subnets_url, notice: 'Aws subnet was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete!(cidr)\n removed = false\n\n # validate object\n if ( !cidr.kind_of?(NetAddr::CIDR) )\n begin\n cidr = NetAddr::CIDR.create(cidr)\n rescue Exception => error\n raise ArgumentError, \"Provided argument raised the following \" +\n \"errors: #{error}\"\n end\n end\n\n # find matching\n me = find_me(cidr)\n\n # remove\n if (me)\n parent = me.tag[:Parent]\n children = me.tag[:Subnets]\n parent.tag[:Subnets].delete(me)\n children.each {|x| add_to_parent(x,parent)}\n removed = true\n end\n\n return(removed)\n end", "def delete!\n PoolNode.rmdir(@id)\n super\n Address.delete(@id)\n Subnet.delete(@subnet)\n end", "def remove_route(subnet, netmask, gateway)\n\t\trequest = Packet.create_request('stdapi_net_config_remove_route')\n\n\t\trequest.add_tlv(TLV_TYPE_SUBNET_STRING, subnet)\n\t\trequest.add_tlv(TLV_TYPE_NETMASK_STRING, netmask)\n\t\trequest.add_tlv(TLV_TYPE_GATEWAY_STRING, gateway)\n\n\t\tresponse = client.send_request(request)\n\n\t\treturn true\n\tend", "def process_cloud_subnets(subnets, operation)\n return if subnets.empty?\n\n if operation == \"destroy\"\n subnets.each do |subnet|\n audit = {\n :event => \"cloud_subnet_record_delete_initiated\",\n :message => \"[#{subnet.name}] Record delete initiated\",\n :target_id => subnet.id,\n :target_class => \"CloudSubnet\",\n :userid => session[:userid]\n }\n AuditEvent.success(audit)\n subnet.delete_cloud_subnet_queue(session[:userid])\n end\n end\n end", "def subnet!(ip, options = {})\n path = \"/subnet/#{ip}\"\n perform_post path, :query => options\n end", "def remove!(cidr)\n removed = false\n found = nil\n\n # validate object\n if ( !cidr.kind_of?(NetAddr::CIDR) )\n begin\n cidr = NetAddr::CIDR.create(cidr)\n rescue Exception => error\n raise ArgumentError, \"Provided argument raised the following \" +\n \"errors: #{error}\"\n end\n end\n\n me = find_me(cidr)\n\n if (me)\n parent = me.tag[:Parent]\n parent.tag[:Subnets].delete(me)\n removed = true\n end\n\n return(removed)\n end", "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def delete_network(name)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_network(name)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def destroy!\n response = @connection.lbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def destroy\n requires :network_acl_id\n\n service.delete_network_acl(network_acl_id)\n true\n end", "def delete_address(name,region)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_address(name,region)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def set_aws_subnet\n @aws_subnet = AwsSubnet.find(params[:id])\n end", "def get_subnet(address)\n addr = IPAddr.new(address)\n subnets = foreman('GET', '/api/subnets')\n subnet = subnets && subnets['results'] && subnets['results'].detect{ |x| IPAddr.new(x['network_address']).include?(addr) }\n subnet or raise Puppet::Error.new(\"Unable to locate subnet for address \\\"#{address}\\\"\")\n end", "def delete\n client.delete_load_balancer(:load_balancer_name => name)\n nil\n end", "def GetSubnet()\n # puts \"Error. GetSubnet not defined\"\n # exit 1\n return @rstack.GetSubnet()\n end", "def GetSubnet()\n \"192.168.3.0/24\"\n end", "def delete_network(network)\n attempt = 0\n begin\n network.destroy\n rescue Fog::Compute::RackspaceV2::ServiceError => e\n if attempt == 3\n puts \"Unable to delete #{network.label}\"\n return false\n end\n puts \"Network #{network.label} Delete Fail Attempt #{attempt}- #{e.inspect}\"\n attempt += 1\n sleep 60\n retry\n end\n return true\nend", "def subnet_id\n data[:subnet_id]\n end", "def remove_subnet_properties\n properties = []\n properties << :Tags\n add_patch Patches::RemoveProperty.new 'AWS::EC2::Subnet', properties\n end", "def GetSubnet()\n \"192.168.0.0/16\"\n end", "def GetSubnet()\n \"192.168.0.0/16\"\n end", "def remove_route(subnet, mask, comm)\n # If a bitmask was supplied, convert it.\n netmask = (mask.to_s =~ /^\\d+$/) ? Rex::Socket.bit2netmask(mask.to_i) : mask\n rv = false\n\n _init\n\n mutex.synchronize {\n self.routes.delete_if { |route|\n if (route.subnet == subnet and route.netmask == netmask and route.comm == comm)\n rv = true\n else\n false\n end\n }\n }\n\n rv\n end", "def save\n requires :vpc_id, :cidr_block\n options = {}\n options['AvailabilityZone'] = availability_zone if availability_zone\n data = service.create_subnet(vpc_id, cidr_block, options).body['subnet']\n new_attributes = data.reject {|key,value| key == 'requestId'}\n merge_attributes(new_attributes)\n true\n\n true\n end", "def remove(net_or_name)\n command = ['VBoxManage', 'dhcpserver', 'remove']\n if net_or_name.kind_of? VirtualBox::Net\n command.push '--ifname', net_or_name.name\n else\n command.push '--netname', net_or_name\n end\n\n VirtualBox.run_command command\n self\n end", "def destroy\n requires :id\n service.delete_vpc(id)\n true\n end", "def deletesecuritygroup\n if not checkRequirements([\"thezone\",\"thefirewall\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/global/firewalls/#{@thefirewall.serial}', :method => 'delete', :options => '', :acces_token => @thezone.token )\n checkQuery(:type => 'global', :token => @thezone.token, :projectname => @thezone.name, :operationname => submit[\"name\"])\n end", "def destroy_and_undefine\n # Shamb0_TODO_20200609=>POC/WT-bringup\n # old_net = @virt.lookup_network_by_name(@net_name)\n # old_net.destroy if old_net.active?\n # old_net.undefine\n rescue StandardError\n # Nothing to clean up\n end", "def delete_network(network)\n return delete_request(address(\"networks/\" + network), @token)\n end", "def delete_network(id)\n fog_service_interface.delete_network(id)\n end", "def delete!(cidr)\n removed = false\n \n # validate object\n if ( !cidr.kind_of?(IPAdmin::CIDR) )\n begin\n cidr = IPAdmin::CIDR.new(:CIDR => cidr)\n rescue Exception => error\n raise ArgumentError, \"Provided argument raised the following \" +\n \"errors: #{error}\"\n end\n end\n\n # find matching\n me = find_me(cidr)\n \n # remove\n if (me)\n parent = me.parent\n children = me.children \n parent.children.delete(me)\n children.each {|x| add_to_parent(x,parent)}\n removed = true\n end\n\n return(removed)\n end", "def destroy\n @sub_region = SubRegion.find(params[:id])\n @sub_region.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_regions_url) }\n format.xml { head :ok }\n end\n end", "def delete(resource_group_name, public_ip_name)\n OOLog.info(\"Deleting public IP '#{public_ip_name}' from '#{resource_group_name}' \")\n start_time = Time.now.to_i\n begin\n public_ip_exists = @network_client.public_ips.check_public_ip_exists(resource_group_name, public_ip_name)\n if !public_ip_exists\n OOLog.info(\"The Public IP #{public_ip_name} does not exist. Moving on...\")\n result = nil\n else\n public_ip = @network_client.public_ips.get(resource_group_name, public_ip_name)\n result = !public_ip.nil? ? public_ip.destroy : Chef::Log.info('AzureNetwork::PublicIp - 404 code, trying to delete something that is not there.')\n end\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.body}\")\n rescue => e\n OOLog.fatal(\"Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.message}\")\n end\n end_time = Time.now.to_i\n duration = end_time - start_time\n OOLog.info(\"operation took #{duration} seconds\")\n result\n end", "def has_subnet?(subnet_id_symbol)\n @subnet_ids.key?(subnet_id_symbol)\n end", "def update\n respond_to do |format|\n if @aws_subnet.update(aws_subnet_params)\n format.html { redirect_to @aws_subnet, notice: 'Aws subnet was successfully updated.' }\n format.json { render :show, status: :ok, location: @aws_subnet }\n else\n format.html { render :edit }\n format.json { render json: @aws_subnet.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete(id)\n request(:delete, \"/network_zones/#{id}.json\")\n end", "def modify_subnet_attribute(subnet_id, options = {})\n params = {}\n params['MapPublicIpOnLaunch.Value'] = options.delete 'MapPublicIpOnLaunch' if options['MapPublicIpOnLaunch']\n request({\n 'Action' => 'ModifySubnetAttribute',\n 'SubnetId' => subnet_id,\n :parser => Fog::Parsers::AWS::Compute::ModifySubnetAttribute.new\n }.merge(params))\n end", "def delete(network_id, id)\n request(:delete, \"/settings/networks/#{network_id}/ip_addresses/#{id}.json\")\n end", "def subnet?(ip)\n get_subnet_or_subnets ip\n end", "def destroy\n @aws_network_acl.destroy\n respond_to do |format|\n format.html { redirect_to aws_network_acls_url, notice: 'Aws network acl was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def subnet_exist?\n return false if current_resource.netmasks.nil? || current_resource.addresses.nil?\n current_resource.netmasks[current_resource.addresses.index(new_resource.address)] == new_resource.netmask\n end", "def destroy \n ec2 = self.class.new_ec2(@resource.value(:user), @resource.value(:password))\n ec2.terminate_instances({:instance_id => @property_hash[:instance_id]})\n ec2.delete_security_group({:group_name => @resource.value(:name)})\n end", "def create_subnet(network, cidr)\n data = {\n 'subnet' => {\n 'network_id' => network,\n 'ip_version' => 4,\n 'cidr' => cidr\n } \n }\n return post_request(address(\"subnets\"), data, @token)\n end", "def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end", "def prune!(cidr)\n pruned = false\n\n # validate object\n if ( !cidr.kind_of?(NetAddr::CIDR) )\n begin\n cidr = NetAddr::CIDR.create(cidr)\n rescue Exception => error\n raise ArgumentError, \"Provided argument raised the following \" +\n \"errors: #{error}\"\n end\n end\n\n me = find_me(cidr)\n\n if (me)\n me.tag[:Subnets].clear\n pruned = true\n end\n\n return(pruned)\n end", "def subnets\n return get_request(address(\"subnets\"), @token)\n end", "def to_s\n \"EC2 Subnet: #{@subnet_id}\"\n end", "def delete_network_vlan(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'vlan_id' => options['vlan_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/vlans/{vlanId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'vlanId' => options['vlan_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n end", "def tinc_subnet\n if CloudModel.config.tinc_network\n NetAddr.parse_net(CloudModel.config.tinc_network).netmask.to_s.gsub(/^\\//, '').to_i\n else\n 16\n end\n end", "def independent_destroy\n if self.subnets.size > 0\n errors.add(:dependents, \"must not have any subnets\")\n return false\n end\n self.destroy\n true\n end", "def delete_rightscale_tag_load_balancer(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new('rightscale_tag_load_balancer', :delete, resource_name)\n end", "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "def delete_cluster\n lb_authenticate = authenticate()\n lb_url = \"\"\n headers = {\"x-auth-token\" => lb_authenticate['auth_token'], \"content-type\" => \"application/json\"}\n lb_authenticate['lb_urls'].each {|lb|\n if config[:lb_region].to_s.downcase == lb['region'].to_s.downcase\n lb_url = lb['publicURL']\n break\n end\n lb_url = lb['publicURL']\n }\n @name_args.each {|arg|\n server_uuids = []\n lb_url = lb_url + \"/loadbalancers/#{arg}\"\n get_uuids = make_web_call(\"get\", lb_url, headers )\n if get_uuids.code == '404'\n ui.msg \"Make sure you specify the -r flag to specify what region the LB is located\"\n exit(1)\n end\n lb_data = JSON.parse(get_uuids.body)\n lb_data['loadBalancer']['metadata'].each{|meta|\n server_uuids << {'uuid' => meta['value'], 'server_name' => meta['key'] }\n }\n server_uuids.each { |uuid|\n rs_delete = RackspaceServerDelete.new\n rs_delete.config[:yes] = 'yes'\n rs_delete.name_args = [ uuid['uuid'] ]\n rs_delete.config[:purge] = true\n rs_delete.config[:chef_node_name] = uuid['server_name']\n rs_delete.run\n }\n delete_lb_call = make_web_call(\"delete\", lb_url, headers)\n puts \"Deleted loadbalancer id #{arg}\"\n \n \n }\n end", "def is_cidr?(subnet_id)\n @ip_matcher.match(subnet_id)\n end", "def leave\n @network = current_organization.networks.find(params[:id])\n\n current_organization.networks.delete(@network)\n redirect_to networks_path\n end", "def destroy\n @network = Network.find(params[:id])\n @network.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_networks_url) }\n format.xml { head :ok }\n end\n end", "def ip_subnet_exist?\n ip_exist? && subnet_exist?\n end", "def destroy\n @auth_ip_address_group.destroy\n head :no_content\n end", "def remove_netif(opts)\n do_remove_netif(opts[:netif].name)\n end", "def create\n @aws_subnet = AwsSubnet.new(aws_subnet_params)\n\n respond_to do |format|\n if @aws_subnet.save\n format.html { redirect_to @aws_subnet, notice: 'Aws subnet was successfully created.' }\n format.json { render :show, status: :created, location: @aws_subnet }\n else\n format.html { render :new }\n format.json { render json: @aws_subnet.errors, status: :unprocessable_entity }\n end\n end\n end", "def delete_secGrp(groupName,vpc=nil)\n start = @serverBranch if vpc == nil or vpc == \"\"\n start = @vpc_serverBranch[vpc] if vpc != nil and vpc != \"\"\n t = @tree.findItem(groupName,start)\n if t != nil\n p = t.parent\n if p != nil\n if (p.text() == \"Servers\" and (vpc == nil or vpc == \"\")) or\n ((vpc != nil and vpc != \"\") and p.text() == vpc)\n @tree.removeItem(t)\n end\n else\n puts \"Security Group not found in tree\"\n end\n else\n puts \"Security Group not found in tree\"\n end\n end", "def destroy\n requires :id\n\n service.delete_internet_gateway(id)\n true\n end", "def delete_floating_ip\n raw_delete_floating_ip\n end", "def remove_netif(opts)\n\n end", "def remove_netif(opts)\n\n end", "def remove_netif(opts)\n\n end", "def destroy\n @network = params[:network]\n @account = current_user.accounts[@network]\n SocialNetworkAccount.destroy(@account.id)\n flash[:notice] = \"Successfully removed the #{@network} network\"\n redirect_to :back\n end", "def delete_pool_member pool_name, address, port\n response = RestClient.delete(\"http://#{@host}/loadbalancers/tenant/#{@tenant}/pools/#{pool_name}/services/#{address + '%3a' + port.to_s}\",\n :content_type => :json,\n :accept => :json,\n :'X-Auth-Token' => @keystone_token)\n case response.code\n when 202\n parse_jobids response\n when 204\n []\n else\n raise LBModelException.new \"Expected HTTP 202 or 204 but got #{response.code} instead\"\n end\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def select_subnet_by_vpc_id(vpc_id)\n res = ec2_client.describe_subnets({\n filters: [{ name: 'vpc-id', values: [vpc_id] }]\n })\n res.subnets\n end", "def del_ip(vid, ip_address)\n perform_request(:action => 'vserver-delip', :vserverid => vid, :ipaddr => ip_address)\n end", "def subnet_by_id(subnet_id_symbol)\n @subnet_ids[subnet_id_symbol]\n end", "def define_vbox_subnet_for_nat(vm, natnet)\n run_shell_cmd(\"VBoxManage modifyvm '#{vm} --natnet1 '#{natnet}'\")\n end", "def delete_image(image_id)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n data = conn.delete_image(image_id)\n if data.status == 200\n data = true\n else\n data = false\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def destroy\n @ip = AllowedIpAddress.find(params[:id])\n @ip.destroy\n\n respond_to do |format|\n flash[:notice] = 'Allowed IP Address was successfully deleted.'\n format.html { redirect_to allowed_ip_address_path }\n format.xml { head :ok }\n end\n end", "def subnet_group\n @dbi.db_subnet_group\n end", "def subnet_group\n @dbi.db_subnet_group\n end", "def remove!(cidr)\n removed = false\n found = nil\n \n # validate object\n if ( !cidr.kind_of?(IPAdmin::CIDR) )\n begin\n cidr = IPAdmin::CIDR.new(:CIDR => cidr)\n rescue Exception => error\n raise ArgumentError, \"Provided argument raised the following \" +\n \"errors: #{error}\"\n end\n end\n\n me = find_me(cidr)\n \n if (me)\n parent = me.parent\n parent.children.delete(me)\n removed = true\n end\n \n return(removed)\n end", "def tenant_delete(tenant_id)\n\t\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/tenants/#{tenant_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = tenant_id\n\t\t end\n\t\t\n\t\tputs \"invoked tenant delete\"\n\tend", "def cleanup_network!\n # Abort if a private network has been defined\n machine.config.vm.networks.each do |cfg|\n return if cfg[0] == :private_network\n end\n machine.communicate.sudo(\"rm -f /etc/nixos/vagrant-network.nix\")\n end", "def db_subnet_group\n data[:db_subnet_group]\n end", "def db_subnet_group\n data[:db_subnet_group]\n end", "def delete_ip_address_pool_subnet_0(ip_pool_id, ip_subnet_id, opts = {})\n delete_ip_address_pool_subnet_0_with_http_info(ip_pool_id, ip_subnet_id, opts)\n nil\n end", "def vpc_subnets\n @group.vpc_zone_identifier.split(',').map(&:strip)\n end", "def destroy\n router_bgp('no')\n end", "def subnets\n out = []\n @conf['dhcpd']['subnets'].each do |subnet|\n out << \"subnet #{subnet['subnet']} netmask #{subnet['netmask']} {\"\n out << dhcpd_options(subnet['options'], 2)\n out << raw_options(subnet['raw_options'], 2)\n out << classes(subnet)\n out << pools(subnet)\n out << '}'\n out << ''\n end\n out << ''\n end", "def associate_with(subnet)\n requires :network_acl_id\n\n # We have to manually find out the network ACL the subnet is currently associated with\n old_id = service.network_acls.all('association.subnet-id' => subnet.subnet_id).first.associations.find { |a| a['subnetId'] == subnet.subnet_id }['networkAclAssociationId']\n service.replace_network_acl_association(old_id, network_acl_id)\n true\n end", "def destroy!\n response = @connection.dbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/instances/#{CloudDB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def delete(nsc)\n parameters = { 'backupid' => @name,\n 'cmd' => 'deleteBackup',\n 'targetTask' => 'backupRestore' }\n xml = AJAX.form_post(nsc, '/admin/global/maintenance/maintCmd.txml', parameters)\n !!(xml =~ /succeded=\"true\"/)\n end", "def destroy\n @cabinet_balancer.destroy\n respond_to do |format|\n format.html { redirect_to cabinet_balancers_path, notice: I18n.t('deleted') }\n format.json { head :no_content }\n end\n end", "def subnets?\n get_subnet_or_subnets\n end", "def deletevolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{@thevolume.serial}', :method => 'delete', :options => '', :access_token => @thezone.token )\n checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n end", "def delete_ip_address_pool_subnet(ip_pool_id, ip_subnet_id, opts = {})\n delete_ip_address_pool_subnet_with_http_info(ip_pool_id, ip_subnet_id, opts)\n nil\n end", "def delete\n data = Storm::Base::SODServer.remote_call '/Network/Pool/delete',\n :uniq_id => @uniq_id\n data[:deleted]\n end", "def delete_address_group(id)\n delete(\"addressGroups/#{id}\")\n end", "def destroy(name, &each_group)\n list(name, &each_group) if each_group\n ret = @@ec2.delete_security_group(:group_name => name)\n (ret && ret['return'] == 'true')\n end", "def destroy\n find_vlan(@reserved_address)\n @reserved_address.destroy\n redirect_to vlan_path(@vlan) \n end", "def remove_netif(netifs, netif)\n end" ]
[ "0.84729993", "0.7955613", "0.72776175", "0.64005053", "0.6343148", "0.6320133", "0.625123", "0.61103386", "0.6010957", "0.5974229", "0.5925765", "0.58072263", "0.577895", "0.57667285", "0.57600766", "0.5737357", "0.5728298", "0.558142", "0.5580356", "0.5567163", "0.5541871", "0.55055517", "0.5500091", "0.5500091", "0.545971", "0.54405123", "0.5431069", "0.5420999", "0.5419705", "0.5397086", "0.5389501", "0.5375973", "0.5341735", "0.5329137", "0.5296", "0.5276855", "0.52763045", "0.5274853", "0.52718943", "0.52441865", "0.5234203", "0.5204776", "0.5199602", "0.51992184", "0.5194216", "0.518058", "0.5171741", "0.51641554", "0.5163441", "0.51405334", "0.51380277", "0.51242006", "0.5101025", "0.5092619", "0.5086567", "0.5066554", "0.5065003", "0.50535625", "0.5036686", "0.503445", "0.50269115", "0.5025883", "0.5019583", "0.50165915", "0.5012372", "0.5007412", "0.5007412", "0.5007412", "0.5002248", "0.5000918", "0.4996729", "0.49892312", "0.49870473", "0.49760255", "0.4970261", "0.49661547", "0.49629423", "0.49619856", "0.49619856", "0.49573195", "0.49460015", "0.49442336", "0.4943788", "0.4943788", "0.49423593", "0.49395955", "0.4937851", "0.49351123", "0.49298042", "0.49215993", "0.49194208", "0.49163783", "0.49139014", "0.49136695", "0.4912058", "0.4907113", "0.49062854", "0.49039993", "0.4890612", "0.4890089" ]
0.7831108
2
Delete DHCP Options. ec2.delete_dhcp_options("doptcb0de3a2") => true
def delete_dhcp_options(dhcp_options_id) link = generate_request("DeleteDhcpOptions", 'DhcpOptionsId' => dhcp_options_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n requires :id\n service.delete_dhcp_options(id)\n true\n end", "def destroy\n @aws_dhcp_option_attribute.destroy\n respond_to do |format|\n format.html { redirect_to aws_dhcp_option_attributes_url, notice: 'Aws dhcp option attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def dhcp_options\n @dhcp_options ||= init_dhcp_options\n end", "def update_dhcp_options(dhcp_options)\n # Verify unmodifiable attributes of existing dhcp_options\n config = dhcp_options.configuration\n if desired_options.any? { |name, value| config[name] != value }\n old_dhcp_options = dhcp_options\n converge_by \"update dhcp_options #{new_resource.name} to #{dhcp_options.id} (was #{old_dhcp_options.id}) and updated VPCs in #{region}\" do\n # create new dhcp_options\n dhcp_options = driver.ec2.dhcp_options.create(config.merge(desired_options))\n action_handler.report_progress \"create new dhcp_options #{dhcp_options.id} in #{region}\"\n # attach dhcp_options to existing vpcs\n old_dhcp_options.vpcs.each do |vpc|\n vpc.dhcp_options = dhcp_options\n action_handler.report_progress \"attach dhcp_options #{dhcp_options.id} to vpc #{vpc.id}\"\n end\n # delete old dhcp_options\n old_dhcp_options.delete\n action_handler.report_progress \"delete old dhcp_options #{old_dhcp_options.id}\"\n end\n new_resource.save_managed_entry(dhcp_options, action_handler)\n end\n end", "def dhcp_options_id\n @vpc.dhcp_options_id\n end", "def delete_dhcp_server_config_with_http_info(dhcp_server_config_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPServerConfigsApi.delete_dhcp_server_config ...'\n end\n # verify the required parameter 'dhcp_server_config_id' is set\n if @api_client.config.client_side_validation && dhcp_server_config_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_server_config_id' when calling PolicyNetworkingIPManagementDHCPDHCPServerConfigsApi.delete_dhcp_server_config\"\n end\n # resource path\n local_var_path = '/global-infra/dhcp-server-configs/{dhcp-server-config-id}'.sub('{' + 'dhcp-server-config-id' + '}', dhcp_server_config_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDHCPDHCPServerConfigsApi#delete_dhcp_server_config\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_dhcp_server_config_0_with_http_info(dhcp_server_config_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPServerConfigsApi.delete_dhcp_server_config_0 ...'\n end\n # verify the required parameter 'dhcp_server_config_id' is set\n if @api_client.config.client_side_validation && dhcp_server_config_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_server_config_id' when calling PolicyNetworkingIPManagementDHCPDHCPServerConfigsApi.delete_dhcp_server_config_0\"\n end\n # resource path\n local_var_path = '/infra/dhcp-server-configs/{dhcp-server-config-id}'.sub('{' + 'dhcp-server-config-id' + '}', dhcp_server_config_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDHCPDHCPServerConfigsApi#delete_dhcp_server_config_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_option(option_id)\n client.delete(\"/customFields/#{id}/options/#{option_id}\")\n end", "def check_osx_dhcpd(options)\n check_osx_dhcpd_installed()\n create_osx_dhcpd_plist()\n service = \"dhcp\"\n check_osx_service_is_enabled(service)\n return\nend", "def delete_option( option )\n option = option.strip\n return false if option.blank?\n\n wp_protect_special_option( option )\n\n Rails.cache.delete 'Railspress::' + 'options' + '/' + option\n true\n end", "def dhcp\n @attributes.fetch('dhcp', false)\n end", "def dhcpd_options(options, indent=0)\n out = []\n options.each do |key, value|\n value = value.join(', ') if value.class == Array\n out << \"#{' '*indent}option #{key} #{value.chomp};\"\n end if options\n out << ''\n end", "def dhcp?\n config[\"dhcp\"]\n end", "def delete_dhcp_server_config_0(dhcp_server_config_id, opts = {})\n delete_dhcp_server_config_0_with_http_info(dhcp_server_config_id, opts)\n nil\n end", "def config_dhcp\t\n\tsystem(\"echo > /etc/dnsmasq.leases\")\n\tdhcp = File.new(\"conf/#@dhcpfile\",\"w+\")\n\tdhcp.puts(\"interface=#@interface\")\n\tdhcp.puts(\"dhcp-range=192.168.10.5,192.168.10.20\\n\")\n\tdhcp.puts(\"dhcp-leasefile=/etc/dnsmasq.leases\\n\")\n\tdhcp.puts(\"dhcp-authoritative\\n\")\n\tdhcp.puts(\"address=/#/192.168.10.1\\n\")\n\tdhcp.close\n\tsystem(\"killall dnsmasq && dnsmasq -C conf/#@dhcpfile\")\nend", "def init_dhcp_options\n @@client.describe_dhcp_options.dhcp_options\n end", "def delete_option(name)\n @options.delete(name)\n end", "def delete(opt)\n ipaddr_modify(RTM_DELADDR, 0, opt)\n end", "def delete_dhcp_server_config(dhcp_server_config_id, opts = {})\n delete_dhcp_server_config_with_http_info(dhcp_server_config_id, opts)\n nil\n end", "def deconfigure\n # assume eth0 primary ip is managed by dhcp\n if name == 'eth0'\n cmd(\"addr flush dev eth0 secondary\")\n else\n cmd(\"rule list\").lines.grep(/^([0-9]+):.*lookup #{route_table}/) do\n cmd(\"rule delete pref #{$1}\")\n end\n cmd(\"addr flush dev #{name}\")\n cmd(\"route flush table #{route_table}\")\n cmd(\"route flush cache\")\n end\n @clean = true\n end", "def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"#{uri_prefix}/virtual_dns/#{id}\")\n end", "def delete(id)\n request(:delete, \"/settings/hypervisor_zones/#{id}.json\")\n end", "def id_dhcp_options\n @id_dhcp_options ||= Hash[dhcp_options.map { |dhcp| [dhcp.dhcp_options_id, dhcp] }]\n end", "def delete_gdom_disk(options)\n gdom_dir = $ldom_base_dir+\"/\"+options['name']\n client_disk = gdom_dir+\"/vdisk0\"\n message = \"Information:\\tRemoving disk \"+client_disk\n command = \"rm #{client_disk}\"\n execute_command(options,message,command)\n return\nend", "def delete_field_option(id)\n delete(\"fieldOptions/#{id}\")\n end", "def destroy\n @billing_option.destroy\n @billing_options = BillingOption.all\n end", "def delete_dhcp_relay_config_with_http_info(dhcp_relay_config_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPRelayConfigsApi.delete_dhcp_relay_config ...'\n end\n # verify the required parameter 'dhcp_relay_config_id' is set\n if @api_client.config.client_side_validation && dhcp_relay_config_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_relay_config_id' when calling PolicyNetworkingIPManagementDHCPDHCPRelayConfigsApi.delete_dhcp_relay_config\"\n end\n # resource path\n local_var_path = '/infra/dhcp-relay-configs/{dhcp-relay-config-id}'.sub('{' + 'dhcp-relay-config-id' + '}', dhcp_relay_config_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDHCPDHCPRelayConfigsApi#delete_dhcp_relay_config\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def destroy\n @dhcp_range = DhcpRange.find(params[:id])\n @dhcp_range.destroy\n\n respond_to do |format|\n format.html { redirect_to dhcp_ranges_url }\n format.json { head :no_content }\n end\n end", "def delete_dhcp_relay_config_0_with_http_info(dhcp_relay_config_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingIPManagementDHCPDHCPRelayConfigsApi.delete_dhcp_relay_config_0 ...'\n end\n # verify the required parameter 'dhcp_relay_config_id' is set\n if @api_client.config.client_side_validation && dhcp_relay_config_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dhcp_relay_config_id' when calling PolicyNetworkingIPManagementDHCPDHCPRelayConfigsApi.delete_dhcp_relay_config_0\"\n end\n # resource path\n local_var_path = '/global-infra/dhcp-relay-configs/{dhcp-relay-config-id}'.sub('{' + 'dhcp-relay-config-id' + '}', dhcp_relay_config_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingIPManagementDHCPDHCPRelayConfigsApi#delete_dhcp_relay_config_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete(pickup_option_id)\n response, status = BeyondApi::Request.delete(@session, \"/pickup-options/#{pickup_option_id}\")\n\n handle_response(response, status, respond_with_true: true)\n end", "def remove\n unless name.nil?\n dhcp.remove self if dhcp\n VirtualBox.run_command ['VBoxManage', 'hostonlyif', 'remove', name]\n end\n self\n end", "def set_aws_dhcp_option_attribute\n @aws_dhcp_option_attribute = AwsDhcpOptionAttribute.find(params[:id])\n end", "def dhcpd\n ensure_authenticated!\n allow :put\n\n unless request.content_type == 'application/json'\n raise UnsupportedMediaType, request.content_type\n end\n\n if params[:vlan].nil? || params[:vlan][:action].nil? ||\n (params[:vlan][:action] != 'start' &&\n params[:vlan][:action] != 'stop')\n raise UnprocessableEntity, \"An action ('start' or 'stop') should be provided\"\n end\n\n @kavlan.dhcpd(params[:id], params[:vlan])\n\n render plain: '',\n status: 204\n end", "def delete_option(key, meta_key = \"_default\")\n values = cama_options(meta_key)\n key = key.to_sym\n values.delete(key) if values.has_key?(key)\n set_meta(meta_key, values)\n end", "def remove_gdom_disk(options)\n vds_disk = options['name']+\"_vdisk0\"\n message = \"Information:\\tRemoving disk \"+vds_disk+\" from Virtual Disk Server\"\n command = \"ldm remove-vdisk #{vds_disk} #{options['name']}\"\n execute_command(options,message,command)\n return\nend", "def delete\n if options.master?\n delete_master(options)\n elsif options.slave?\n delete_slave(options)\n else\n invoke :help, [:delete]\n end\n end", "def destroy\n @ddconfig.destroy\n end", "def unconfigure_cc_server(options)\n unconfigure_ks_repo(options['service'])\nend", "def delete_administrative_ip(opts)\n opts = check_params(opts,[:admin_ips])\n super(opts)\n end", "def destroy\n requires :id\n service.delete_vpc(id)\n true\n end", "def cfg_delete(cfg)\n obj_delete cfg, ZoneConfiguration\n end", "def delete_kms_config request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_kms_config_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def del_ip(vid, ip_address)\n perform_request(:action => 'vserver-delip', :vserverid => vid, :ipaddr => ip_address)\n end", "def unconfigure_vs_pxe_client(options)\n options['mac'] = get_install_nac(options)\n if not options['mac']\n handle_output(options,\"Warning:\\tNo MAC Address entry found for #{options['name']}\")\n quit(options)\n end\n tftp_pxe_file = options['mac'].gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n tftp_pxe_file = options['tftpdir']+\"/\"+tftp_pxe_file\n if File.exist?(tftp_pxe_file)\n message = \"Information:\\tRemoving PXE boot file \"+tftp_pxe_file+\" for \"+options['name']\n command = \"rm #{tftp_pxe_file}\"\n execute_command(options,message,command)\n end\n pxe_cfg_dir = options['tftpdir']+\"/pxelinux.cfg\"\n pxe_cfg_file1 = options['mac'].gsub(/:/,\"-\")\n pxe_cfg_file1 = \"01-\"+pxe_cfg_file1\n pxe_cfg_file1 = pxe_cfg_file1.downcase\n pxe_cfg_file1 = pxe_cfg_dir+\"/\"+pxe_cfg_file1\n pxe_cfg_file2 = options['mac'].split(\":\")[0..3].join+\"-\"+options['mac'].split(\":\")[4..5].join+\"-0000-0000-\"+options['mac'].gsub(/\\:/,\"\")\n pxe_cfg_file2 = pxe_cfg_file2.downcase\n pxe_cfg_file2 = pxe_cfg_dir+\"/\"+pxe_cfg_file2\n if File.exist?(pxe_cfg_file1)\n message = \"Information:\\tRemoving PXE boot config file \"+pxe_cfg_file1+\" for \"+options['name']\n command = \"rm #{pxe_cfg_file1}\"\n execute_command(options,message,command)\n end\n if File.exist?(pxe_cfg_file2)\n message = \"Information:\\tRemoving PXE boot config file \"+pxe_cfg_file2+\" for \"+options['name']\n command = \"rm #{pxe_cfg_file2}\"\n execute_command(options,message,command)\n end\n client_info = get_vs_clients()\n options['service'] = client_info.grep(/#{options['name']}/)[0].split(/ = /)[1].chomp\n ks_dir = options['tftpdir']+\"/\"+options['service']\n ks_cfg_file = ks_dir+\"/\"+options['name']+\".cfg\"\n if File.exist?(ks_cfg_file)\n message = \"Information:\\tRemoving Kickstart boot config file \"+ks_cfg_file+\" for \"+options['name']\n command = \"rm #{ks_cfg_file}\"\n execute_command(options,message,command)\n end\n unconfigure_vs_dhcp_client(options)\n return\nend", "def delete_floating_ip\n raw_delete_floating_ip\n end", "def delete_per_instance_configs request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n uri, body, _query_string_params = transcode_delete_per_instance_configs_request request_pb\n response = @client_stub.make_post_request(\n uri: uri,\n body: body,\n options: options\n )\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, response if block_given?\n result\n end", "def delete!\n response = @compute.connection.csreq(\"DELETE\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}\",@svrmgmtport,@svrmgmtscheme)\n OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def delete_access_config request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_access_config_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def destroy\n @auto_option = AutoOption.find(params[:id])\n @auto_option.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto_options_url) }\n format.xml { head :ok }\n end\n end", "def delete(options={})\n DNSimple::Client.delete \"templates/#{id}\", options\n end", "def delete options = {}\n client_opts = {}\n client_opts[:force_delete] = options[:force] == true\n client_opts[:auto_scaling_group_name] = name\n client.delete_auto_scaling_group(client_opts)\n nil\n end", "def del_ip(vid, ip_address)\n perform_request(action: 'vserver-delip', vserverid: vid, ipaddr: ip_address)\n end", "def _dhcp_options(data)\n pos = 0xF0\n loop do\n break if data.length <= pos + 3\n typ = data[pos]\n len = data[pos+1]\n break if data.length <= pos + 2 + len or typ == 0\n yield [ typ, data[pos+2, len] ]\n pos += 2 + len\n end\n end", "def delete_settings(instance_id)\n url = \"#{@endpoint}/instances/#{instance_id}/settings\"\n\n response = @client.delete(url, {:header => @headers})\n\n unless [200, 404].include? response.status\n cloud_error(\"Cannot delete settings for '#{instance_id}', got HTTP #{response.status}\")\n end\n\n true\n end", "def delete_address_list(id)\n delete(\"addressGroups/#{id}\")\n end", "def delete(network_id, id)\n request(:delete, \"/settings/networks/#{network_id}/ip_addresses/#{id}.json\")\n end", "def delete_vbox_vm_config(client_name)\n vbox_vm_dir = get_vbox_vm_dir(client_name)\n config_file = vbox_vm_dir+\"/\"+client_name+\".vbox\"\n if File.exist?(config_file)\n message = \"Removing:\\tVirtualbox configuration file \"+config_file\n command = \"rm \\\"#{config_file}\\\"\"\n execute_command(message,command)\n end\n return\nend", "def destroy\n @adoption.destroy\n respond_to do |format|\n format.html { redirect_to adoptions_url, notice: 'Adoption was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @option = Option.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to(options_url) }\n format.xml { head :ok }\n end\n end", "def delete(name, _options = {})\n exec(\"delete\", c: name, p: port)\n end", "def delete_address(id)\n delete(\"addresses/#{id}\")\n end", "def destroy\n @option.destroy\n respond_to do |format|\n format.html { redirect_to options_url, notice: 'Option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_ssh_key(id, options = {})\n user_id = options.delete :user_id\n if user_id.to_i.zero?\n delete(\"/user/keys/#{id}\")\n else\n delete(\"/users/#{user_id}/keys/#{id}\")\n end\n end", "def destroy\n @auto_option = AutoOption.find(params[:id])\n @auto_option.destroy\n\n respond_to do |format|\n format.html { redirect_to auto_options_url }\n format.json { head :no_content }\n end\n end", "def handle_dhcp(zone_name, network_name, network_entry, address_start, address_end)\n resource_dhcp = Wire::Resource::ResourceFactory\n .instance.create(:dhcpconfig, \"wire__#{zone_name}\", network_name,\n network_entry, address_start, address_end)\n default_handle_resource(resource_dhcp, :dnsmasq,\n \"dnsmasq/dhcp config on network \\'#{network_name}\\'\", :down)\n rescue => e\n $log.error \"processing dhcp configuration: #{e}\"\n end", "def destroy\n @hybridization_option = HybridizationOption.find(params[:id])\n @hybridization_option.destroy\n\n respond_to do |format|\n format.html { redirect_to(hybridization_options_url) }\n format.xml { head :ok }\n end\n end", "def delete_options_statement\n super\n end", "def delete_customer_repricing_config request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_customer_repricing_config_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def delete_floating_ip(id)\n check_extension(\"os-floating-ips\")\n @connection.req(\"DELETE\", \"/os-floating-ips/#{id}\")\n true\n end", "def cfdelete(dist_id) # cf://DIST_ID\n send_command \"cfdelete\", dist_id\n end", "def destroy\n @dns_zone = DnsZone.find(params[:id])\n @dns_zone.destroy\n\n respond_to do |format|\n format.html { redirect_to(dns_zones_url) }\n format.xml { head :ok }\n end\n end", "def unconfigure_fusion_vm(options)\n stop_fusion_vm(options)\n exists = check_fusion_vm_exists(options)\n if exists == true\n stop_fusion_vm(options)\n if options['host-os-name'].to_s.match(/Linux/)\n fusion_vm_dir = options['fusiondir']+\"/\"+options['name']\n else\n fusion_vm_dir = options['fusiondir']+\"/\"+options['name']+\".vmwarevm\"\n end\n fusion_vmx_file = fusion_vm_dir+\"/\"+options['name']+\".vmx\"\n message = \"Deleting:\\t#{options['vmapp']} VM \"+options['name']\n command = \"'#{options['vmrun']}' -T fusion deleteVM '#{fusion_vmx_file}'\"\n execute_command(options,message,command)\n vm_dir = options['name']+\".vmwarevm\"\n message = \"Removing:\\t#{options['vmapp']} VM \"+options['name']+\" directory\"\n command = \"cd \\\"#{options['fusiondir']}\\\" ; rm -rf \\\"#{vm_dir}\\\"\"\n execute_command(options,message,command)\n else\n if options['verbose'] == true\n handle_output(options,\"Warning:\\t#{options['vmapp']} VM #{options['name']} does not exist\")\n end\n end\n return\nend", "def index\n @aws_dhcp_option_attributes = AwsDhcpOptionAttribute.all\n end", "def aws_instance_block_device_ebs_delete_on_termination_set(opts)\n AWS::EC2.new.client.modify_instance_attribute(\n instance_id: opts[:instance].id,\n attribute: \"blockDeviceMapping\",\n block_device_mappings: [device_name: opts[:block_device][:device_name], ebs:{ delete_on_termination: true}]\n )\n end", "def network_objects_add_dhcp_option(rule_name,data)\n\n dhcp_list = data.split(',')\n self.msg(rule_name, :debug, 'network_objects_add_dhcp_option', \"dhcp_list\" +dhcp_list.to_s)\n \n dhcp_list.each do |dhcp|\n \n self.msg(rule_name, :debug, 'network_objects_add_dhcp_option', \"processing dhcp_option\" +dhcp.to_s)\n \n @ff.link(:href, 'javascript:mimic_button(\\'add: ...\\', 1)').click\n @ff.select_list(:name, 'net_obj_type').select_value('64')\n \n if dhcp.size > 0\n \n dhcp_opts=dhcp.split(':')\n \n if dhcp_opts[0] == \"Vendor\"\n @ff.select_list(:name, 'dhcp_opt_code').select_value('60')\n end\n \n if dhcp_opts[0] == \"Client\"\n @ff.select_list(:name, 'dhcp_opt_code').select_value('61')\n end\n \n if dhcp_opts[0] == \"User\"\n @ff.select_list(:name, 'dhcp_opt_code').select_value('77')\n end\n \n self.msg(rule_name, :debug, 'network_objects_add_dhcp_option', \"set dhcp\" +dhcp)\n \n @ff.text_field(:name, 'dhcp_opt_type').set(dhcp_opts[1].to_s)\n @ff.link(:text, 'Apply').click\n \n end # end of if\n \n end # end of each\n \n end", "def create_dhcp_server(network, options)\n end", "def destroy\n @dns_device_assoc = DnsDeviceAssoc.find(params[:id])\n @dns_device_assoc.destroy\n\n respond_to do |format|\n format.html { redirect_to dns_device_assocs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @stage_common_option.destroy\n end", "def destroy\n requires :vpn_connection_id\n\n service.delete_vpn_connection(vpn_connection_id)\n true\n end", "def remove(options = {})\n requires :ip\n raise Fog::Errors::Error.new('Ip is not attached to a server.') if serverid.nil?\n data = service.ip_remove({:ipaddress => ip}.merge!(options)).body[\"response\"][\"details\"]\n merge_attributes data\n end", "def delete_dhcp_relay_config_0(dhcp_relay_config_id, opts = {})\n delete_dhcp_relay_config_0_with_http_info(dhcp_relay_config_id, opts)\n nil\n end", "def aws_dhcp_option_attribute_params\n params.require(:aws_dhcp_option_attribute).permit(:dhcp_options_id, :key, :value)\n end", "def destroy\n @option = Option.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to options_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @option = Option.find(params[:id])\n @option.destroy\n\n respond_to do |format|\n format.html { redirect_to options_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @option.destroy\n respond_to do |format|\n format.html { redirect_to options_url, notice: 'Option was successfully destroyed.' }\n end\n end", "def destroy\n @wp_dyna_config = WpDynaConfig.find(params[:id])\n @wp_dyna_config.destroy\n\n respond_to do |format|\n format.html { redirect_to wp_dyna_configs_url }\n format.json { head :no_content }\n end\n end", "def remove_netif(opts)\n\n end", "def remove_netif(opts)\n\n end", "def remove_netif(opts)\n\n end", "def delete_key(key_id, options = {})\n boolean_from_response :delete, \"/user/keys/#{key_id}\", options\n end", "def delete(opt)\n raise \"Missing vlan_id\" unless opt[:vlan_id]\n raise \"Missing link\" unless opt[:link]\n link = list(:link=>opt[:link]).find { |l|\n l.linkinfo.data &&\n l.linkinfo.data.id == opt[:vlan_id]\n }\n raise Errno::ENODEV unless link\n @rtsocket.link.delete(link.index)\n end", "def destroy\n @dhcp_scope = DhcpScope.find(params[:id])\n @dhcp_scope.destroy\n\n respond_to do |format|\n format.html { redirect_to(dhcp_scopes_url) }\n format.xml { head :ok }\n end\n end", "def delete_gdom_dir(options)\n gdom_dir = $ldom_base_dir+\"/\"+options['name']\n destroy_zfs_fs(gdom_dir)\n return\nend", "def delete_options\n if domain.primary?\n {\n 'action' => 'deleteRec',\n 'rid' => self.id.to_s,\n 'did' => domain.id.to_s,\n 'domain' => domain.host_base64\n }\n else\n {\n 'action' => 'deleteRec',\n 'dynrid' => self.id.to_s,\n 'dynid' => domain.id.to_s,\n 'domain' => domain.host_base64\n }\n end\n end", "def delete_access_key(access_key_id, options = {})\n request({\n 'AccessKeyId' => access_key_id,\n 'Action' => 'DeleteAccessKey',\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n }.merge!(options))\n end", "def delete(id, options = {})\n @raw = send_delete_request(@conn, [\"/v1/acl/policy/#{id}\"], options, nil)\n @raw.body.chomp == 'true'\n end", "def destroy\n @card_ip.destroy\n end", "def destroy\n dns_entry_response = RestClient.delete('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records/:identifier',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n @dns_entry.destroy\n respond_to do |format|\n format.html { redirect_to dns_entries_url, notice: \"Dns entry was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end" ]
[ "0.8420959", "0.6863806", "0.6480748", "0.6448804", "0.6369895", "0.61514276", "0.60612226", "0.60586494", "0.6022748", "0.59883505", "0.597475", "0.59474516", "0.59318", "0.58906984", "0.58425814", "0.58199286", "0.576356", "0.57190824", "0.5701034", "0.56766", "0.5669369", "0.566521", "0.564647", "0.5640548", "0.56352663", "0.55970126", "0.5588356", "0.55740166", "0.5520277", "0.55022144", "0.54923725", "0.5466801", "0.5466035", "0.5448666", "0.5409023", "0.5404366", "0.5398211", "0.53898275", "0.5385016", "0.5365798", "0.5357596", "0.5347815", "0.53455746", "0.53414416", "0.533188", "0.53069514", "0.5304954", "0.5291985", "0.52850413", "0.5264337", "0.526284", "0.5262057", "0.5249266", "0.5247392", "0.52435946", "0.52274", "0.52206814", "0.5215518", "0.5199621", "0.5194077", "0.51924217", "0.51878095", "0.51781523", "0.51683396", "0.5165925", "0.5165522", "0.51641476", "0.5160476", "0.51444155", "0.5140316", "0.513889", "0.5131874", "0.5128567", "0.51218885", "0.5121509", "0.5110083", "0.5107205", "0.5105381", "0.5097835", "0.50952274", "0.50950354", "0.50940967", "0.50824785", "0.5080613", "0.50790584", "0.50790584", "0.5076551", "0.50706524", "0.50649416", "0.50649416", "0.50649416", "0.50544655", "0.5050062", "0.5046606", "0.5042242", "0.5037478", "0.50360984", "0.5029446", "0.50262135", "0.50240064" ]
0.79963267
1
Delete customer gateway. ec2.delete_customer_gateway("cgwd5a643bc") => true
def delete_customer_gateway(customer_gateway_id) link = generate_request("DeleteCustomerGateway", 'CustomerGatewayId' => customer_gateway_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def destroy\n @payment_gateway.destroy\n respond_to do |format|\n flash[:success] = 'Payment gateway was successfully deleted.'\n format.html { redirect_to payment_gateways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_payment_gateways_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to payment_gateways_url }\n format.json { head :ok }\n end\n end", "def destroy\n requires :id\n\n service.delete_internet_gateway(id)\n true\n end", "def delete_vpn_gateway(vpn_gateway_id)\n link = generate_request(\"DeleteVpnGateway\", 'VpnGatewayId' => vpn_gateway_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def remove_customer(customer)\n respond_with customer.to_vaulted_billing\n end", "def remove_customer(customer)\n respond_with customer.to_vaulted_billing\n end", "def delete(payment_gateway_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'paymentGatewayId', payment_gateway_id)\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'delete', 'bool', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def delete_customer_phone(customer_id, phone_id)\n delete(\"customers/#{customer_id}/phones/#{phone_id}\")\n end", "def destroy\n @gateway_setup.destroy\n respond_to do |format|\n format.html { redirect_to new_gateway_setup_url, notice: 'Gateway setup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(customer_id)\n response, status = BeyondApi::Request.delete(@session, \"/customers/#{customer_id}\")\n\n handle_response(response, status, respond_with_true: true)\n end", "def delete_router_gateway(router)\n data = { 'router' => {'external_gateway_info' => nil}}\n return put_request(address('routers/' + router), data, @token)\n end", "def destroy\n @customer.destroy\n end", "def delete(params = {})\n req = WebPay::CustomerIdRequest.create(params)\n raw_response = @client._request(:delete, 'customers' + '/' + req.id.to_s, req)\n WebPay::CustomerResponse.new(raw_response)\n end", "def destroy\n @customer_app.destroy\n end", "def test_deleting_cancels_in_gateway\n Freemium.gateway.expects(:cancel).once.returns(nil)\n subscriptions(:bobs_subscription).destroy\n end", "def delete_customer_by_id(customer_id)\n host = Swagger.configuration.host\n api_key = Swagger.configuration.private_api_key\n\n conn = Faraday.new\n resp = conn.delete do |req|\n req.url \"https://#{host}/api/customer/#{customer_id}\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['Authorization'] = 'Basic ' + [\"#{api_key}:\"].pack('m').delete(\"\\r\\n\")\n end\n body = JSON.parse(resp.body)\n Swagger::Response.new(resp.status, body)\n return body\n end", "def delete_payment\n request = DeleteCustomerPaymentProfileRequest.new(nil, nil, profile.profile_id, payment_profile_id)\n authnet(:api).delete_customer_payment_profile(request)\n end", "def delete_customer(customer_id:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/customers/{customer_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'customer_id' => { 'value' => customer_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.delete(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def destroy\n @customer = @order.customer\n @order.destroy\n redirect_to @customer, notice: \"The order was successfully deleted.\"\n end", "def delete_customer(customer_id:,\n version: nil)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::DELETE,\n '/v2/customers/{customer_id}',\n 'default')\n .template_param(new_parameter(customer_id, key: 'customer_id')\n .should_encode(true))\n .query_param(new_parameter(version, key: 'version'))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def stripe_customer_deleted(event, req)\n customer = event['data']['object']\n id = customer['id']\n log.debug({ type: 'method', data: \"stripe_customer_deleted -- #{id}\" })\n dealership = dealer_dao.get_by_email(customer['email'])\n return false unless dealership && dealership.customer_id == id\n log.debug({ type: 'notice', message: \"Found dealership with #{customer['email']} and #{id}\" })\n stripe_customer = Stripe::Customer.retrieve(id)\n return false unless stripe_customer.deleted\n log.debug({ type: 'notice', message: \"Verified #{id} was deleted with Stripe\" })\n dealer_dao.delete(dealership.id)\n end", "def destroy\n @customer_tax_zone.destroy\n respond_to do |format|\n format.html { redirect_to customer_tax_zones_url, notice: 'Customer tax zone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create_customer_in_gateway\n return success if @payment_nonce_uuid.blank?\n\n r = \"GatewayManagement::Customer::Create::#{@gateway_nonce.gateway_type.camelize}\".constantize.\n new(customer: @customer, client_id: @client.id, gateway_nonce: @gateway_nonce).perform\n\n return r unless r.success?\n\n @gateway_customer_associations = [r.data[:gateway_customer_association]]\n\n @gateway_nonce.status = GlobalConstant::GatewayNonce.used_status\n @gateway_nonce.save!\n\n success\n end", "def destroy\n @customer.destroy\n redirect_to customers_url\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to admin_customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n @customer = Customer.find(params[:id])\n @customer.destroy\n\n respond_to do |format|\n format.html { redirect_to user_customers_url(current_user) }\n format.json do\n render json: {\n customer: @customer,\n status: :deleted\n }.to_json\n end\n end\n end", "def rec_delete(zone, zoneid)\n send_req({a: :rec_delete, z: zone, id: zoneid})\n end", "def destroy\n @reach_out_to_customer.destroy\n respond_to do |format|\n format.html { redirect_to reach_out_to_customers_url }\n format.json { head :no_content }\n end\n end", "def test_deleting_cancels_in_gateway\n #Freemium.gateway.expects(:unstore).once.returns(nil)\n subscription = Factory(:paid_subscription)\n @paid_plan = subscription.subscription_plan\n subscription.destroy\n\n assert_changed(subscription.subscribable, :cancellation, @paid_plan, nil)\n end", "def delete_customer(opts = {})\n data, _status_code, _headers = delete_customer_with_http_info(opts)\n data\n end", "def delete(client, region = 'AWS_REGION')\r\n super\r\n api_id = get_id_for_api(@api_name)\r\n if api_id\r\n options = {\r\n rest_api_id: api_id\r\n }\r\n @client.delete_rest_api(options)\r\n puts \"Deleted API: #{@api_name} ID:#{api_id}\"\r\n else\r\n puts \"API Gateway Object #{@api_name} not found. Nothing to delete.\"\r\n end\r\n true\r\n end", "def destroy_from_open_pay\n OpenPay::Customer.new.destroy(open_pay_id) if open_pay_id.present?\n end", "def destroy\n\n # Destroy the customer account on Stripe.com if the id is present.\n if self.customer_id.present?\n begin\n Stripe.api_key = ENV['API_KEY']\n customer = Stripe::Customer.retrieve(\"#{self.customer_id}\")\n customer.delete\n rescue Stripe::StripeError => stripe_error\n logger.debug(\"[Account.delete] stripe error = #{stripe_error.message}\")\n errors[:customer_id] << stripe_error.message\n\n # continue to raise the exception\n raise Stripe::StripeError, stripe_error.message\n end\n end\n\n super()\n end", "def delete_customer request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_customer_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def update_customer_in_gateway\n resp = gateway_client.update_customer(update_params)\n return resp unless resp.success?\n\n puts(resp.inspect)\n\n success\n end", "def destroy\n authorize @customer, :destroy?\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer_address.destroy\n respond_to do |format|\n format.html { redirect_to customer_addresses_url, notice: 'Customer address was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer_segment.destroy\n respond_to do |format|\n format.html { redirect_to @business_model_canvase }\n format.json { head :no_content }\n end\n end", "def delete\n authenticated('/account') do\n enforce_method! :POST\n assert_params :confirm, :custid\n if req.params[:confirm] && cust.custid == req.params[:custid]\n cust.destroy!\n res.delete_cookie :sess\n sess.destroy! :all\n @cust = Stella::Customer.anonymous\n @sess = Stella::Session.new\n Stella::Analytics.event \"Delete account\"\n res.redirect '/'\n else\n sess.add_info_message! \"Account was not deleted. You must click confirm.\"\n res.redirect '/account'\n end\n end\n end", "def delete_customer_email(customer_id, email_id)\n delete(\"customers/#{customer_id}/emails/#{email_id}\")\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Cliente eliminado exitosamente.' }\n end\n end", "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n\n head :no_content\n end", "def destroy\n @customer_branch = current_customer.company_branches.find(params[:id])\n\n begin\n @customer_branch.update_attribute(:deleted, true)\n redirect_to customer_customer_branches_path(current_customer), notice: I18n.t('commons.successfully_deleted')\n rescue ActiveRecord::DeleteRestrictionError => e\n redirect_to customer_path(current_customer), notice: e.message\n rescue\n redirect_to customer_customer_branches_path(current_customer), alert: I18n.t('commons.cannot_delete')\n end\n end", "def destroy\n @customer_order.destroy\n respond_to do |format|\n format.html { redirect_to admin_url, notice: 'Customer order was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @billing_address = BillingAddress.find(params[:id])\n @billing_address.destroy\n\n respond_to do |format|\n format.html { redirect_to billing_addresses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @address_customer = AddressCustomer.find(params[:id])\n @address_customer.destroy\n\n respond_to do |format|\n format.html { redirect_to address_customers_url }\n format.json { head :no_content }\n end\n end", "def del_zone(user_key, zone)\n send_req({act: :zone_delete, user_key: user_key, zone_name: zone})\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'データが削除されました。' }\n format.json { head :no_content }\n end\n end", "def delete_active_card(params = {})\n req = WebPay::CustomerIdRequest.create(params)\n raw_response = @client._request(:delete, 'customers' + '/' + req.id.to_s + '/' + 'active_card', req)\n WebPay::CustomerResponse.new(raw_response)\n end", "def destroy\n\n tookan = {\"api_key\": \"50646180f541481e4c422b614c5825431be3c2f82fd57936541c03\", \"customer_id\": @tenant.customer_id}\n response = RestClient.post \"https://api.tookanapp.com/v2/delete_customer\", tookan.to_json, :content_type => \"application/json\"\n response = JSON.parse(response)\n if response[\"status\"] == 200\n \n @tenant.destroy\n respond_to do |format|\n format.html { redirect_to tenants_url, notice: 'Tenant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n \n end", "def destroy\n @customer = Customer.find(params[:id])\n @customer.destroy\n redirect_to(action: \"index\")\n end", "def delete\n ensure_service!\n service.delete_backup instance_id, backup_id\n true\n end", "def remove_customer_credit_card(customer, credit_card)\n respond_with credit_card.to_vaulted_billing\n end", "def destroy\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n if Shipment.where(\"customer_id = ?\", @customer.id ).count > 0\n respond_to do |format|\n format.html { redirect_to greenhouse_customer_path(@greenhouse.id, @customer.id), notice: 'Customer wtih associated transactions cannot be deleted.' }\n end\n else\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to greenhouse_customers_path(@greenhouse.id), notice: 'Customer was successfully destroyed.' }\n #format.json { head :no_content }\n end\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: t(\"activerecord.controller_msg.customer.destroyed\", :default => 'Customer was successfully destroyed.') }\n format.json { head :no_content }\n end\n end", "def customer_destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'データが削除されました。' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer_customer.destroy\n respond_to do |format|\n format.html { redirect_to customer_customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @merchant.destroy\n head :no_content\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @auto_bill_payment.destroy\n redirect_to account_auto_bill_payments_url, notice: 'Auto bill payment was successfully destroyed.'\n end", "def zone_delete(zone)\n obj_delete zone, Zone\n end", "def delete_customer_card(customer_id:,\n card_id:)\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/v2/customers/{customer_id}/cards/{card_id}'\n _query_builder = APIHelper.append_url_with_template_parameters(\n _query_builder,\n 'customer_id' => { 'value' => customer_id, 'encode' => true },\n 'card_id' => { 'value' => card_id, 'encode' => true }\n )\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare headers.\n _headers = {\n 'accept' => 'application/json'\n }\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.delete(\n _query_url,\n headers: _headers\n )\n OAuth2.apply(config, _request)\n _response = execute_request(_request)\n\n # Return appropriate response type.\n decoded = APIHelper.json_deserialize(_response.raw_body)\n _errors = APIHelper.map_response(decoded, ['errors'])\n ApiResponse.new(\n _response, data: decoded, errors: _errors\n )\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n end\n end", "def tenant_delete(tenant_id)\n\t\n\t\tdelete_call = Curl::Easy.http_delete(\"#{@ip_address}:#{@port_2}/v2.0/tenants/#{tenant_id}\"\n\t\t) do |curl|\n\t\t\tcurl.headers['x-auth-token'] = @token\n\t\t\tcurl.headers['userId'] = tenant_id\n\t\t end\n\t\t\n\t\tputs \"invoked tenant delete\"\n\tend", "def delete(destination, nexthop = nil)\n cmd = \"no ip route #{destination}\"\n cmd << \" #{nexthop}\" if nexthop\n configure cmd\n end", "def delete_customer_card(customer_id:,\n card_id:)\n warn 'Endpoint delete_customer_card in CustomersApi is deprecated'\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::DELETE,\n '/v2/customers/{customer_id}/cards/{card_id}',\n 'default')\n .template_param(new_parameter(customer_id, key: 'customer_id')\n .should_encode(true))\n .template_param(new_parameter(card_id, key: 'card_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "def destroy\n if @customer.delete\n redirect_to customers_path, notice: \"O Clinte #{@customer.name} foi apagado!\"\n else\n render :index\n end\n\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end", "def destroy\n customer_invoice_last = @customer_invoice.sales_order.cost_center_id\n if @customer_invoice.destroy\n recalculate_cost_center(customer_invoice_last)\n render :json => @customer_invoice\n else \n render :json => @customer_invoice.errors.full_messages\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_path, notice: 'Customer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @customer.destroy\n respond_to do |format|\n format.html { redirect_to customers_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.8375744", "0.6895204", "0.6833198", "0.66712445", "0.6517801", "0.6488889", "0.6185644", "0.6076983", "0.6076983", "0.6051314", "0.6018349", "0.6008825", "0.59804004", "0.59573954", "0.59382427", "0.58884317", "0.586029", "0.5835617", "0.58298254", "0.57514703", "0.57210726", "0.57133585", "0.5712164", "0.56869566", "0.56739175", "0.5663952", "0.56482625", "0.5640661", "0.5619355", "0.5602396", "0.55625254", "0.55615944", "0.5551422", "0.55505997", "0.55468094", "0.5540284", "0.55374336", "0.5535098", "0.5521376", "0.5513686", "0.5503918", "0.54973936", "0.5496894", "0.5493407", "0.54709715", "0.54578453", "0.54517096", "0.54477817", "0.5446955", "0.54280436", "0.5418711", "0.54186904", "0.541469", "0.540791", "0.5406813", "0.5404863", "0.5402833", "0.53990895", "0.53988117", "0.5392121", "0.5391955", "0.5382821", "0.537873", "0.5362724", "0.53556913", "0.5354015", "0.5349602", "0.5347267", "0.53461283", "0.5335527", "0.5329477", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.53262144", "0.5325259", "0.53221047", "0.53139406", "0.53136957", "0.53123116", "0.53123116", "0.53123116", "0.53123116", "0.53123116", "0.53123116", "0.53123116" ]
0.83043444
1
Detach VPN gateway. ec2.detach_vpn_gateway('vgwdfa144b6','vpc890ce2e0') => true
def detach_vpn_gateway(vpn_gateway_id, vpc_id) link = generate_request("DetachVpnGateway", 'VpnGatewayId' => vpn_gateway_id, 'VpcId' => vpc_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_vpn_gateway(vpn_gateway_id)\n link = generate_request(\"DeleteVpnGateway\", 'VpnGatewayId' => vpn_gateway_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def detach(vpc_id)\n requires :id\n service.detach_internet_gateway(id, vpc_id)\n reload\n end", "def destroy\n requires :vpn_connection_id\n\n service.delete_vpn_connection(vpn_connection_id)\n true\n end", "def vpn_down\n vpn_sw = params[:vpn_sw]\n vpn_status = VpnStatus.DOWN\n Node.all.each do |node|\n node.update_vpn_status vpn_status,\"0.0.0.0\",vpn_sw\n end\n render status: :created, :text => \"\"\n end", "def destroy\n router_bgp('no')\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def detachvolume\n if not checkRequirements([\"thezone\",\"theserver\",\"thevolume\"]) \n return false\n end\n checkToken(@thezone)\n data = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@theserver.azone.name}/instances/#{@theserver.serial}/detachDisk', :method => 'post', :options => '', :access_token => @thezone.token )\n data ? data[\"floating_ip\"][\"ip\"] : false\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_payment_gateways_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end", "def destroy\n @payment_gateway.destroy\n respond_to do |format|\n flash[:success] = 'Payment gateway was successfully deleted.'\n format.html { redirect_to payment_gateways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to payment_gateways_url }\n format.json { head :ok }\n end\n end", "def destroy\n requires :id\n\n service.delete_internet_gateway(id)\n true\n end", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def unbind\n @gateway_handler.disconnect(self)\n end", "def delete_router_gateway(router)\n data = { 'router' => {'external_gateway_info' => nil}}\n return put_request(address('routers/' + router), data, @token)\n end", "def destroy\n @vpn = current_user.vpn\n @vpn.destroy\n\n respond_to do |format|\n format.html { redirect_to dashboard_url }\n format.json { head :no_content }\n end\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def shutdown!\n @gateway&.shutdown!\n sleep 0.5 until !@gateway&.active?\n @gateway = nil\n end", "def destroy\n requires :id\n service.delete_vpc(id)\n true\n end", "def unconfigure_vbox_vm(client_name)\n check_vbox_is_installed()\n exists = check_vbox_vm_exists(client_name)\n if exists == \"no\"\n puts \"VirtualBox VM \"+client_name+\" does not exist\"\n exit\n end\n stop_vbox_vm(client_name)\n sleep(5)\n message = \"Deleting:\\tVirtualBox VM \"+client_name\n command = \"VBoxManage unregistervm #{client_name} --delete\"\n execute_command(message,command)\n return\nend", "def deallocate(proposal, service, network)\n Command::VirtualIP::Deallocate.new(\n *command_params(\n proposal: proposal,\n service: service,\n network: network\n )\n ).execute\n rescue => e\n catch_errors(e)\n end", "def remove_vpc_gateway_attachment_properties\n properties = []\n properties << :VpnGatewayId\n add_patch Patches::RemoveProperty.new 'AWS::EC2::VPCGatewayAttachment', properties\n end", "def delete\n execute(\"unregistervm\", @uuid, \"--delete\")\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id}):v2\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id) if @stemcell_api_version < 2\n end\n end\n end", "def del_ip(vid, ip_address)\n perform_request(:action => 'vserver-delip', :vserverid => vid, :ipaddr => ip_address)\n end", "def stop_pvm_instance(instance_id)\n post(\n \"cloud-instances/#{guid}/pvm-instances/#{instance_id}/action\",\n {\"action\" => \"stop\"}.to_json\n )\n end", "def delete_vm\n unless @vm\n info 'No VM assigned, nothing to delete'\n return false\n end\n system(\"knife node delete #{chef_name} -y\")\n # TODO: make changes here after switching to newer version of OpenNebula\n locate_vm(id).finalize\n @vm = nil\n @ip = nil\n true\n end", "def destroy\n @gateway_setup.destroy\n respond_to do |format|\n format.html { redirect_to new_gateway_setup_url, notice: 'Gateway setup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def del_ip(vid, ip_address)\n perform_request(action: 'vserver-delip', vserverid: vid, ipaddr: ip_address)\n end", "def destroy\n @card_ip.destroy\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id)\n end\n end\n end", "def delete_vm\n osapi = Apiexternal::Osapi.new\n\n begin\n osapi.delete_vm(nova_id)\n rescue Exceptions::NextDeployException => me\n me.log\n end\n\n # delete hiera and vcl files\n clear_vmfiles\n generate_host_all\n end", "def cleanup_network!\n # Abort if a private network has been defined\n machine.config.vm.networks.each do |cfg|\n return if cfg[0] == :private_network\n end\n machine.communicate.sudo(\"rm -f /etc/nixos/vagrant-network.nix\")\n end", "def unbridge bridge_id\n post \"bridges/#{bridge_id}\", {callIds: []}\n\n nil\n end", "def disconnect_ssh_tunnel\n @logger.debug('closing SSH tunnel..')\n\n @ssh.shutdown! unless @ssh.nil?\n @ssh = nil\n end", "def stop(_no_sync = nil)\n @gateway.stop\n end", "def delete\n config = get\n return true unless config\n configure(\"no router bgp #{config[:bgp_as]}\")\n end", "def destroy(state)\n return if state[:vm_name].nil?\n\n save_and_validate_parameters\n connect\n vm = get_vm(state[:vm_name])\n\n vm_obj = Com::Vmware::Vcenter::VM.new(vapi_config)\n\n # shut the machine down if it is running\n if vm.power_state.value == \"POWERED_ON\"\n power = Com::Vmware::Vcenter::Vm::Power.new(vapi_config)\n power.stop(vm.vm)\n end\n\n # delete the vm\n vm_obj.delete(vm.vm)\n end", "def leave\n @network = current_organization.networks.find(params[:id])\n\n current_organization.networks.delete(@network)\n redirect_to networks_path\n end", "def unregister\n VirtualBox.run_command ['VBoxManage', 'unregistervm', uid, '--delete']\n self\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @instance_manager.find(instance_id).terminate(fast_path_delete?)\n end\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @instance_manager.find(instance_id).terminate(fast_path_delete?)\n end\n end", "def delete_vpn_connection(vpn_connection_id)\n link = generate_request(\"DeleteVpnConnection\", 'VpnConnectionId' => vpn_connection_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def deprovision\n reverse_method_proxy(:deprovision)\n\n true\n end", "def destroy_vm(_pool_name, _vm_name)\n\n machine = virtual_box.find_machine(:nameOrId => _vm_name)\n return true if machine.nil?\n \n sess = @web_session_mgr.get_session_object\n begin\n machine.lock_machine(:session => sess, :lockType => 'VM')\n progress = sess.console.power_down()\n progress.wait_for_completion(:timeout => -1)\n rescue Exception => e\n $logger.log('s', \"[x] can't destroy vm: can't get lock [#{_pool_name}] '#{machine}'. #{e.message}\")\n return false\n end\n\n begin\n machine.unregister(:cleanupMode => 'Full')\n rescue Exception => e\n $logger.log('s', \"[x] can't unregister vm: can't get lock [#{_pool_name}] '#{machine}'. #{e.message}\")\n return false\n end\n\n return true\n\n end", "def off\n attachment = hpg_resolve(shift_argument)\n return unless confirm_command(attachment.config_var, 'Deactiving will destroy all backups')\n action(\"Dectivating #{attachment.config_var} (#{attachment.resource_name})\") do\n RestClient.delete( authed_pgsnapshot_url(\"/client/resource/#{attachment.resource_name}\"))\n end\n end", "def destroy!\n response = @connection.dbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/instances/#{CloudDB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def deallocate(vmname, action = 'deallocate')\n uri = @uri + \"/#{vmname}/#{action}?api-version=#{api_version}\"\n uri\n end", "def destroy\n @network_dvr.destroy\n respond_to do |format|\n format.html { redirect_to network_dvrs_url, notice: 'Network dvr was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @wireless_router.destroy\n respond_to do |format|\n format.html { redirect_to wireless_routers_url, notice: 'Wireless router was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def disassociate_address(public_ip)\n link = generate_request(\"DisassociateAddress\", \n \"PublicIp\" => public_ip.to_s)\n request_info(link, RightBoolResponseParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def disassociate_address(public_ip)\n link = generate_request(\"DisassociateAddress\", \n \"PublicIp\" => public_ip.to_s)\n request_info(link, RightBoolResponseParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def detach_disk(instance, zone, device_name)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.detach_disk(instance, zone, device_name)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def rvs_disconnect\n return false unless rvs_key.present?\n rvs_connection.delete('/api-keys/current').status == 200\n end", "def detach(id, network_id)\n request(:post, \"/network_zones/#{id}/networks/#{network_id}/detach.json\")\n end", "def destroy\n requires :ip\n remove(:release => true)\n end", "def detach()\n $ec2.describe_volumes([self.id]).each do |result|\n if result[:aws_attachment_status] == 'attached'\n $ec2.detach_volume(self.id)\n end\n end\n self.attached_instance = nil\n self.save()\n end", "def destroy\n requires :id\n service.delete_dhcp_options(id)\n true\n end", "def disconnect(verbose = false)\n\n if File.exists?(@pidfile)\n\n ovpn_pid_from_file = File.read(@pidfile).to_i\n ovpn_pid = get_process_id\n if ovpn_pid != ovpn_pid_from_file\n puts \"Pid file contains PID different to currently running process #{ovpn_pid}\"\n ovpn_pid = ovpn_pid_from_file\n end\n\n else\n ovpn_pid = get_process_id\n end\n\n if ! ovpn_pid.nil?\n begin\n Process.getpgid(ovpn_pid)\n if @interactive\n if agree(\"Disconnect VPN? \", true)\n kill_and_clean(ovpn_pid)\n exit 0\n end\n else\n kill_and_clean(ovpn_pid)\n exit 0\n end\n rescue Errno::ESRCH => e\n puts \"#{ovpn_pid} PROCESS does not exist ... #{e}\"\n if File.exists?(@pidfile)\n File.delete(@pidfile)\n end\n exit 1\n end\n else\n puts \"No OpenVPN process appears to be running\"\n exit 0\n end\n\n end", "def destroy\n deleteVm = Virtualmachine.new\n @response_del = deleteVm.deleteVMcall(@virtualmachine.RemoteID)\n @virtualmachine.destroy\n respond_to do |format|\n format.html { redirect_to virtualmachines_url,notice: 'Virtual server will be delete shortly.' }\n format.json { head :no_content }\n end\n end", "def stop_vm\n exit_status = nil\n @vm_running = false\n begin\n exit_status = vmm_command(eb(@config['vmm']['quitvmm']))\n sleep 1\n # Check to see if it is still running.\n is_alive = (Process.kill(0, @vmm_pid) rescue 0)\n if is_alive != 0\n @log.warn \"Warning, vmm didn't die.. killing manually\"\n Process.kill(\"TERM\",@vmm_pid)\n sleep 2\n end\n rescue PTY::ChildExited\n true # expected\n end\n return exit_status\n end", "def destroy!\n response = @connection.lbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def delete_virtualization_virtual_network(moid, opts = {})\n delete_virtualization_virtual_network_with_http_info(moid, opts)\n nil\n end", "def unconfigure_parallels_vm(options)\n check_parallels_is_installed(options)\n exists = check_parallels_vm_exists(options)\n if exists == false\n handle_output(options,\"Parallels VM #{options['name']} does not exist\")\n quit(options)\n end\n stop_parallels_vm(options)\n sleep(5)\n message = \"Deleting Parallels VM \"+options['name']\n command = \"prlctl delete #{options['name']}\"\n execute_command(options,message,command)\n message = \"Unregistering Parallels VM \"+options['name']\n command = \"prlctl unregister #{options['name']}\"\n execute_command(options,message,command)\n return\nend", "def delete_pg\n pg_name = self['BRIDGE']\n sw_name = self['TEMPLATE/VCENTER_SWITCH_NAME']\n\n raise \"Missing BRIDGE from VNET template\" if pg_name.empty?\n raise \"Missing VCENTER_SWTICH_NAME from VNET template\" if sw_name.empty?\n\n errors = []\n\n #-----------------------------------------------------------------------\n # Iterate over all clusters and hosts to remove PG\n #-----------------------------------------------------------------------\n @clusters.each do |cluster|\n cli = cluster[:cli]\n\n cluster[:ccr]['host'].each do |host|\n begin\n esx = VCenterDriver::ESXHost.new_from_ref(host._ref, cli)\n\n next unless esx.pg_exists(pg_name)\n\n sw = esx.remove_pg(pg_name)\n\n next if !sw || sw_name != sw\n\n vswitch = esx.vss_exists(sw_name)\n next unless vswitch\n\n # Remove switch if the port group being removed is the last one\n esx.remove_vss(sw_name) if vswitch.portgroup.empty?\n\n rescue StandardError => e\n msg = \"\\tHost #{esx._ref}. Reason: \\\"#{e.message}\\\".\\n\"\n msg << \"#{e.backtrace}\\n\" if @debug\n\n errors << msg\n end\n end\n end\n\n #-----------------------------------------------------------------------\n # Notify error on PG removal error\n #-----------------------------------------------------------------------\n unless errors.empty?\n message = \"Error deleting port group from hosts:\\n\"\n message << errors.join\n\n raise message\n end\n end", "def delete_floating_ip\n raw_delete_floating_ip\n end", "def remove_route(subnet, netmask, gateway)\n\t\trequest = Packet.create_request('stdapi_net_config_remove_route')\n\n\t\trequest.add_tlv(TLV_TYPE_SUBNET_STRING, subnet)\n\t\trequest.add_tlv(TLV_TYPE_NETMASK_STRING, netmask)\n\t\trequest.add_tlv(TLV_TYPE_GATEWAY_STRING, gateway)\n\n\t\tresponse = client.send_request(request)\n\n\t\treturn true\n\tend", "def unsubscribe_plan\n proxies.delete(remote_plan)\n subscriptions.delete(remote_plan)\n if connected?\n call(:removed_sibling, @remote_plan, connection_space.plan.remote_id)\n end\n end", "def stop!\n return unless started?\n return if @process.nil?\n\n SSHTunnel.logger.info \"Stopping tunnel : #{self}\"\n\n @process.terminate\n @process.wait\n @started = false\n @process = nil\n end", "def disassociate_address(public_ip)\n action = 'DisassociateAddress'\n params = {\n 'Action' => action,\n 'PublicIp' => public_ip\n }\n\n response = send_query_request(params)\n response.is_a?(Net::HTTPSuccess)\n end", "def delete_tunnel\n super\n end", "def release_public_ip params\n params.to_sym!\n\n vn = onblock(:vn, params[:vn], @client)\n vn.info!\n\n if vn.rm_ar(params[:ar]).nil? then\n AR.where(vnid: params[:vn], arid: params[:ar], owner: vn['//UID']).update(etime: Time.now.to_i)\n true\n else\n false\n end\n end", "def deactivate(payment_method_id)\n response, status = BeyondApi::Request.post(@session, \"/payment-methods/#{payment_method_id}/deactivate\")\n\n handle_response(response, status, respond_with_true: true)\n end", "def delete_vbox_vm_config(client_name)\n vbox_vm_dir = get_vbox_vm_dir(client_name)\n config_file = vbox_vm_dir+\"/\"+client_name+\".vbox\"\n if File.exist?(config_file)\n message = \"Removing:\\tVirtualbox configuration file \"+config_file\n command = \"rm \\\"#{config_file}\\\"\"\n execute_command(message,command)\n end\n return\nend", "def unbind_device_from_gateway request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_unbind_device_from_gateway_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def delete_vm(vm_id)\n with_thread_name(\"delete_vm(#{vm_id}\") do\n begin\n # Skip if the VM does not exist\n return unless has_vm?(vm_id)\n vm = @vm_manager.get_virtual_machine(vm_id, true, true)\n unless vm['power_state'] == 'off'\n @logger.info('Switching off the VM...')\n @vm_manager.set_power_state(vm_id, 'off')\n end\n @logger.info('Detaching persistent disks attached to VM.')\n vm['vm_disk_info'].each do |disk|\n # If a volume is attached to the virtual machine\n # then detach it before deleting the virtual machine\n vol_group_uuid = disk['disk_address']['volume_group_uuid']\n unless vol_group_uuid.nil?\n @vol_group_manager.detach_from_vm(vol_group_uuid, vm_id)\n @logger.info(\"Detached volume group #{vol_group_uuid}.\")\n end\n end\n @vm_manager.delete_virtual_machine(vm_id)\n @logger.info('Deleted the virtual machine.')\n rescue => e\n @logger.error(e)\n cloud_error(e.message)\n end\n end\n end", "def destroy\n if delete_payment_profile and super\n return true\n else\n return false\n end\n end", "def delete_vpc(vpc_id)\n return if vpc_id.nil? || !configured?\n\n @client.delete_vpc(vpc_id: vpc_id)\n end", "def destroy\n @payment_method.destroy\n end", "def delete_virtualbox_vm(vm_name)\n @colour.notify \"Deleting VirtualBox VM #{vm_name}\"\n @colour.notify \"VirtualBox VM #{vm_name} deleted\" if system \"VBoxManage unregistervm #{vm_name} --delete\"\nend", "def destroy\n find_vlan(@reserved_address)\n @reserved_address.destroy\n redirect_to vlan_path(@vlan) \n end", "def disable(payment_gateway_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'paymentGatewayId', payment_gateway_id)\n\t\t\tclient.queue_service_action_call('householdpaymentgateway', 'disable', 'bool', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def unlink_banner(banner)\n raise \"Zone must be saved\" if new_record?\n raise ArgumentError.new(\"Banner must be saved\")if banner.new_record?\n\n session = Base.connection\n server = XMLRPC::Client.new2(\"#{session.url}#{self.class.endpoint}\")\n server.call(\"unlinkBanner\", session.id, self.id, banner.id)\n end", "def deregister_tunnel_connection(connection)\n @tunnel_connections.delete connection.connection_id\n control_connection = connection.control_connection\n @tunnel_connections_by_control[control_connection].delete connection\n end", "def destroy\n @v_netweight = VNetweight.find(params[:id])\n @v_netweight.destroy\n\n respond_to do |format|\n format.html { redirect_to(v_netweights_url) }\n format.xml { head :ok }\n end\n end", "def unassign(_, _, opts = {})\n rc = @client.detach_nic(@deploy_id, opts[:vultr_id])\n\n if VultrError.error?(rc)\n OpenNebula.log_error(\"Error unassiging #{rc.message}\")\n return 1\n end\n\n 0\n end", "def detach_nic(mac)\n\n eth = @vm.config.hardware.device.find { |d|\n (d.class.ancestors[1] == RbVmomi::VIM::VirtualEthernetCard) &&\n (d.macAddress == mac)\n }\n\n return -1 if eth.nil?\n\n spec = {\n :deviceChange => [\n :operation => :remove,\n :device => eth\n ]\n }\n\n @vm.ReconfigVM_Task(:spec => spec).wait_for_completion\n end", "def detach_from(load_balancers, instance)\n check_arguments(instance: instance, load_balancers: load_balancers)\n\n load_balancers.select do |lb|\n matched_instance = lb.instances.any? do |lb_instance|\n instance.ec2_instance_id == lb_instance.instance_id\n end\n\n if matched_instance && lb.instances.count > 1\n # We can detach this instance safely because there is at least one other\n # instance to handle traffic\n true\n elsif matched_instance && lb.instances.count == 1\n # We can't detach this instance because it's the only one\n log(<<-MSG.split.join(\" \"))\n Will not detach #{instance.hostname} from load balancer\n #{lb.load_balancer_name} because it is the only instance connected\n MSG\n\n false\n else\n # This load balancer isn't attached to this instance\n false\n end\n end\n end", "def delete_vpc(vpc_id)\n link = generate_request(\"DeleteVpc\", 'VpcId' => vpc_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def delete_server!(conn, server_name, delete_volumes = false)\n server = conn.servers.find{ |i| i.name == server_name }\n if server\n @log.info \"Deleting instance with name: #{server_name}\"\n # check and delete any floating ip addresses associated with instance\n server.all_addresses.each do |address|\n if address['ip']\n begin\n @log.info \"Disassociating floating ip address associated with instance: #{server.name}\"\n conn.disassociate_address(server.id, address['ip'])\n @log.info \"Releasing floating ip address: #{address['ip']}\"\n conn.release_address(conn.addresses.find {|a| a.ip == address['ip']}.id)\n rescue Exception => ex\n @log.debug \"Error encountered releasing floating ip, reason: #{ex}\"\n # continue\n end\n end\n end\n server.destroy\n if delete_volumes\n volume_service = Fog::Volume::OpenStack.new(\n :openstack_api_key => @os_password,\n :openstack_username => @os_username,\n :openstack_auth_url => @os_auth_url,\n :openstack_tenant => @os_tenant,\n )\n vols_to_del = volume_service.volumes.find{|v| v.display_name =~ /#{server_name}/}\n if vols_to_del\n vols_to_del.each do |vol|\n @log.info \"Waiting for volume to detach from instance: #{server_name}\"\n wait_for_vol(volume_service, vol.id)\n vol.destroy\n end\n else\n @log.info \"No volumes attached for the instance #{server_name}\"\n end\n end\n end\n end", "def delete_vcenter(vcenter_id=nil, auth=nil, cert=nil)\n check_vcenter(vcenter_id)\n payload = {\n }.to_json\n rest_post(payload, \"#{@base_url}/compute/vcenters/#{vcenter_id}/deactivate\", auth.nil? ? @auth_token : auth, cert.nil? ? @verify_cert : cert)\n end", "def destroy \n ec2 = self.class.new_ec2(@resource.value(:user), @resource.value(:password))\n ec2.terminate_instances({:instance_id => @property_hash[:instance_id]})\n ec2.delete_security_group({:group_name => @resource.value(:name)})\n end", "def delete\n ensure_service!\n service.delete_backup instance_id, backup_id\n true\n end", "def vm_delete(vm)\n connection[vms_collection].find(_id: vm).delete_one\n end", "def destroy\n @relay_destination.destroy\n respond_to do |format|\n format.html { redirect_to @relay, notice: 'Relay destination was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end", "def destroy!\n response = @connection.lbreq(\"DELETE\",@lbmgmthost,\"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@load_balancer.id.to_s)}/healthmonitor\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n @enabled = false\n true\n end", "def delete_l2_vpn(tier_0_id, locale_service_id, l2vpn_id, opts = {})\n delete_l2_vpn_with_http_info(tier_0_id, locale_service_id, l2vpn_id, opts)\n nil\n end", "def deactivate\n @client.delete(\"paypal_accounts/#{id}\")\n @attributes['active'] = false\n true\n end" ]
[ "0.65123874", "0.6361243", "0.62730455", "0.59608024", "0.5887733", "0.5845077", "0.5825646", "0.5697991", "0.55941606", "0.5589475", "0.55568457", "0.5531404", "0.5480342", "0.5466503", "0.54130226", "0.5395616", "0.53945833", "0.5380723", "0.536856", "0.5331706", "0.5273601", "0.52716655", "0.5175159", "0.51734424", "0.5169129", "0.515485", "0.51489735", "0.5142665", "0.51092106", "0.5084228", "0.50635564", "0.50615937", "0.50591916", "0.50487864", "0.5008158", "0.49990648", "0.49915338", "0.4973674", "0.49660087", "0.49646425", "0.49603385", "0.49603385", "0.4960328", "0.49593216", "0.4958001", "0.49459365", "0.4912623", "0.4907312", "0.48808", "0.487021", "0.48596734", "0.48596734", "0.4852288", "0.48511472", "0.48508984", "0.48331228", "0.4816928", "0.48112118", "0.48094636", "0.4791794", "0.4776032", "0.4756319", "0.47535303", "0.47500476", "0.47469935", "0.47427675", "0.47421178", "0.4741262", "0.47383642", "0.47383553", "0.47314277", "0.4726184", "0.4723506", "0.47156182", "0.47116005", "0.4707796", "0.47076115", "0.46998423", "0.4693311", "0.46930495", "0.4682957", "0.46822056", "0.468019", "0.46787554", "0.4676439", "0.46654755", "0.46637917", "0.4655667", "0.46470654", "0.4645199", "0.4642893", "0.46424222", "0.46405375", "0.46256226", "0.4624974", "0.46237198", "0.46235335", "0.4620254", "0.46148768", "0.46107832" ]
0.78283596
0
Delete vpn gateway. ec2.delete_vpn_gateway("vgwdfa144b6") => true
def delete_vpn_gateway(vpn_gateway_id) link = generate_request("DeleteVpnGateway", 'VpnGatewayId' => vpn_gateway_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def destroy\n @payment_gateway.destroy\n respond_to do |format|\n flash[:success] = 'Payment gateway was successfully deleted.'\n format.html { redirect_to payment_gateways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_payment_gateways_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to payment_gateways_url }\n format.json { head :ok }\n end\n end", "def detach_vpn_gateway(vpn_gateway_id, vpc_id)\n link = generate_request(\"DetachVpnGateway\", 'VpnGatewayId' => vpn_gateway_id,\n 'VpcId' => vpc_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def destroy\n requires :id\n\n service.delete_internet_gateway(id)\n true\n end", "def destroy\n requires :vpn_connection_id\n\n service.delete_vpn_connection(vpn_connection_id)\n true\n end", "def delete_router_gateway(router)\n data = { 'router' => {'external_gateway_info' => nil}}\n return put_request(address('routers/' + router), data, @token)\n end", "def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end", "def destroy\n @gateway_setup.destroy\n respond_to do |format|\n format.html { redirect_to new_gateway_setup_url, notice: 'Gateway setup was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_customer_gateway(customer_gateway_id)\n link = generate_request(\"DeleteCustomerGateway\", 'CustomerGatewayId' => customer_gateway_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def delete(payment_gateway_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'paymentGatewayId', payment_gateway_id)\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'delete', 'bool', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def destroy\n @vpn = current_user.vpn\n @vpn.destroy\n\n respond_to do |format|\n format.html { redirect_to dashboard_url }\n format.json { head :no_content }\n end\n end", "def delete_vpn_connection(vpn_connection_id)\n link = generate_request(\"DeleteVpnConnection\", 'VpnConnectionId' => vpn_connection_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def destroy\n router_bgp('no')\n end", "def destroy\n requires :id\n service.delete_vpc(id)\n true\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id)\n end\n end\n end", "def delete_vm\n osapi = Apiexternal::Osapi.new\n\n begin\n osapi.delete_vm(nova_id)\n rescue Exceptions::NextDeployException => me\n me.log\n end\n\n # delete hiera and vcl files\n clear_vmfiles\n generate_host_all\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id}):v2\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id) if @stemcell_api_version < 2\n end\n end\n end", "def delete(destination, nexthop = nil)\n cmd = \"no ip route #{destination}\"\n cmd << \" #{nexthop}\" if nexthop\n configure cmd\n end", "def destroy\n @gateway_stat.destroy\n respond_to do |format|\n format.html { redirect_to gateway_stats_url, notice: 'Gateway stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_gateway_policy_0(domain_id, gateway_policy_id, opts = {})\n delete_gateway_policy_0_with_http_info(domain_id, gateway_policy_id, opts)\n nil\n end", "def destroy\n @admin_hotspot = Admin::Hotspot.find(params[:id])\n @admin_hotspot.destroy\n\n flash[:notice] = 'Hotspot was successfully deleted.'\n respond_to do |format|\n format.html { redirect_to admin_hotspots_url }\n format.json { head :no_content }\n end\n end", "def test_deleting_cancels_in_gateway\n Freemium.gateway.expects(:cancel).once.returns(nil)\n subscriptions(:bobs_subscription).destroy\n end", "def remove(payment_gateway_id, payment_method_id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'paymentGatewayId', payment_gateway_id)\n\t\t\tclient.add_param(kparams, 'paymentMethodId', payment_method_id)\n\t\t\tclient.queue_service_action_call('householdpaymentmethod', 'remove', 'bool', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def delete(virtual_machine_id, ip_address_id)\n request(:delete, \"/virtual_machines/#{virtual_machine_id}/ip_addresses/#{ip_address_id}.json\")\n end", "def destroy\n requires :id\n service.delete_dhcp_options(id)\n true\n end", "def destroy\n @payment_method.destroy\n end", "def destroy\n @banner = Banner.find params[:id]\n @banner.destroy\n redirect_to admin_banners_path\n end", "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def destroy\n @hotspot_registration.destroy\n respond_to do |format|\n format.html { redirect_to admin_guests_url, notice: 'Guest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_floating_ip\n raw_delete_floating_ip\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @instance_manager.find(instance_id).terminate(fast_path_delete?)\n end\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @instance_manager.find(instance_id).terminate(fast_path_delete?)\n end\n end", "def destroy\n @gruppi_banner = GruppiBanner.find(params[:id])\n @gruppi_banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(gruppi_banners_url) }\n format.xml { head :ok }\n end\n end", "def shutdown!\n @gateway&.shutdown!\n sleep 0.5 until !@gateway&.active?\n @gateway = nil\n end", "def delete\n config = get\n return true unless config\n configure(\"no router bgp #{config[:bgp_as]}\")\n end", "def destroy\n @wireless_router.destroy\n respond_to do |format|\n format.html { redirect_to wireless_routers_url, notice: 'Wireless router was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_vpc(vpc_id)\n return if vpc_id.nil? || !configured?\n\n @client.delete_vpc(vpc_id: vpc_id)\n end", "def delete_vpc(vpc_id)\n link = generate_request(\"DeleteVpc\", 'VpcId' => vpc_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_banners_url) }\n format.xml { head :ok }\n end\n end", "def delete_payment\n @payment = PaymentFromDestination.find(params[:id])\n @payment.delete\n \n render :nothing => true\n end", "def destroy\n @ip = AllowedIpAddress.find(params[:id])\n @ip.destroy\n\n respond_to do |format|\n flash[:notice] = 'Allowed IP Address was successfully deleted.'\n format.html { redirect_to allowed_ip_address_path }\n format.xml { head :ok }\n end\n end", "def delete_pg\n pg_name = self['BRIDGE']\n sw_name = self['TEMPLATE/VCENTER_SWITCH_NAME']\n\n raise \"Missing BRIDGE from VNET template\" if pg_name.empty?\n raise \"Missing VCENTER_SWTICH_NAME from VNET template\" if sw_name.empty?\n\n errors = []\n\n #-----------------------------------------------------------------------\n # Iterate over all clusters and hosts to remove PG\n #-----------------------------------------------------------------------\n @clusters.each do |cluster|\n cli = cluster[:cli]\n\n cluster[:ccr]['host'].each do |host|\n begin\n esx = VCenterDriver::ESXHost.new_from_ref(host._ref, cli)\n\n next unless esx.pg_exists(pg_name)\n\n sw = esx.remove_pg(pg_name)\n\n next if !sw || sw_name != sw\n\n vswitch = esx.vss_exists(sw_name)\n next unless vswitch\n\n # Remove switch if the port group being removed is the last one\n esx.remove_vss(sw_name) if vswitch.portgroup.empty?\n\n rescue StandardError => e\n msg = \"\\tHost #{esx._ref}. Reason: \\\"#{e.message}\\\".\\n\"\n msg << \"#{e.backtrace}\\n\" if @debug\n\n errors << msg\n end\n end\n end\n\n #-----------------------------------------------------------------------\n # Notify error on PG removal error\n #-----------------------------------------------------------------------\n unless errors.empty?\n message = \"Error deleting port group from hosts:\\n\"\n message << errors.join\n\n raise message\n end\n end", "def deleteWaypoint _wp\n SQF.deleteWaypoint _wp\n end", "def delete\n execute(\"unregistervm\", @uuid, \"--delete\")\n end", "def delete_instance instance_id\n execute do\n instances.delete_instance(\n instance_path(instance_id)\n )\n end\n end", "def delete\n ensure_service!\n service.delete_backup instance_id, backup_id\n true\n end", "def destroy\n @card_ip.destroy\n end", "def destroy\n @switchgearconnection = Switchgearconnection.find(params[:id])\n @switchgearconnection.destroy\n redirect_to switchgearconnections_path, :notice => 'Schaltgerätekombination wurde gelöscht.'\n end", "def destroy\r\n @invoice = Invoice.find(params[:id])\r\n @retail_plan = RetailPlan.find(@invoice.retail_plan_id)\r\n billing_site_id = @retail_plan.billing_site_id\r\n @invoice.destroy\r\n redirect_to billing_site_url(billing_site_id), notice: 'Invoice has been destroyed successfully !'\r\n end", "def unbind\n @gateway_handler.disconnect(self)\n end", "def destroy\n @vip_global_region.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_global_regions_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted an amx vip global region: #{@vip_global_region.name}\")\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @site_banner = SiteBanner.find(params[:id])\n @site_banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_banners_url) }\n format.xml { head :ok }\n end\n end", "def delete\n client_opts = {}\n client_opts[:network_interface_id] = network_interface_id\n client.delete_network_interface(client_opts)\n nil\n end", "def delete(resource_group_name, public_ip_name)\n OOLog.info(\"Deleting public IP '#{public_ip_name}' from '#{resource_group_name}' \")\n start_time = Time.now.to_i\n begin\n public_ip_exists = @network_client.public_ips.check_public_ip_exists(resource_group_name, public_ip_name)\n if !public_ip_exists\n OOLog.info(\"The Public IP #{public_ip_name} does not exist. Moving on...\")\n result = nil\n else\n public_ip = @network_client.public_ips.get(resource_group_name, public_ip_name)\n result = !public_ip.nil? ? public_ip.destroy : Chef::Log.info('AzureNetwork::PublicIp - 404 code, trying to delete something that is not there.')\n end\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.body}\")\n rescue => e\n OOLog.fatal(\"Error deleting PublicIP '#{public_ip_name}' in ResourceGroup '#{resource_group_name}'. Exception: #{e.message}\")\n end\n end_time = Time.now.to_i\n duration = end_time - start_time\n OOLog.info(\"operation took #{duration} seconds\")\n result\n end", "def delete(network_id, id)\n request(:delete, \"/settings/networks/#{network_id}/ip_addresses/#{id}.json\")\n end", "def delete_vm\n unless @vm\n info 'No VM assigned, nothing to delete'\n return false\n end\n system(\"knife node delete #{chef_name} -y\")\n # TODO: make changes here after switching to newer version of OpenNebula\n locate_vm(id).finalize\n @vm = nil\n @ip = nil\n true\n end", "def destroy\n @vip_phone.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_phones_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip phone: #{@vip_phone.phone}\")\n end", "def destroy\n @auth_ip_address_group.destroy\n head :no_content\n end", "def remove_vpc_gateway_attachment_properties\n properties = []\n properties << :VpnGatewayId\n add_patch Patches::RemoveProperty.new 'AWS::EC2::VPCGatewayAttachment', properties\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_banners_url, :notice => 'Banner Deletado com Sucesso') }\n format.xml { head :ok }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n @ip_adress.destroy\n respond_to do |format|\n format.html { redirect_to ip_adresses_url, notice: 'Ip adress was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_gateway_rule_0(domain_id, gateway_policy_id, rule_id, opts = {})\n delete_gateway_rule_0_with_http_info(domain_id, gateway_policy_id, rule_id, opts)\n nil\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admins_banners_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cargapp_payment.destroy\n respond_to do |format|\n format.html { redirect_to cargapp_payments_url, notice: 'Cargapp payment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tunnel\n super\n end", "def delete(sObjectType, hParams)\n case sObjectType\n when :network\n HPNetwork.delete_network(hParams[:network_connection],\n hParams[:network])\n when :rule\n HPSecurityGroups.delete_rule(hParams[:network_connection],\n hParams[:id])\n obj = hParams[:network_connection]\n obj.security_group_rules.get(hParams[:id]).destroy\n when :server\n required?(hParams, :compute_connection)\n required?(hParams, :server)\n HPCompute.delete_server(hParams[:compute_connection],\n hParams[:server])\n end\n end", "def destroy\n deleteVm = Virtualmachine.new\n @response_del = deleteVm.deleteVMcall(@virtualmachine.RemoteID)\n @virtualmachine.destroy\n respond_to do |format|\n format.html { redirect_to virtualmachines_url,notice: 'Virtual server will be delete shortly.' }\n format.json { head :no_content }\n end\n end", "def delete(vmname)\n uri = @uri + \"/#{vmname}?api-version=#{api_version}\"\n uri\n end", "def gateway\n @attributes.fetch('gateway', nil)\n end", "def gateway\n @config[:gateway]\n end", "def destroy\n @payment_plan.destroy\n respond_to do |format|\n redirect_to payment_plans_url, notice: 'Payment plan was successfully destroyed.'\n end\n end", "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n \n respond_to do |format|\n format.html { redirect_to banners_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_payment_method = Admin::AccountsPaymentMethod.find(params[:id])\n @admin_payment_method.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_accounts_payment_methods_url }\n format.json { head :ok }\n end\n end", "def destroy\n @banner_placement = BannerPlacement.find(params[:id])\n @banner_placement.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_banner_placements_url) }\n format.xml { head :ok }\n end\n end", "def payment_gateway_type\n gateway_setting.gateway_type\n end", "def destroy\n @home_banner = HomeBanner.find(params[:id])\n \n if @home_banner.is_main\n flash[:error] = \"Can't delete the main banner, set another as main first\"\n redirect_to(admin_home_banners_url) and return\n end\n \n @home_banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_home_banners_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @aws_dhcp_option_attribute.destroy\n respond_to do |format|\n format.html { redirect_to aws_dhcp_option_attributes_url, notice: 'Aws dhcp option attribute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n execute_request { faraday_connection.delete }\n end", "def destroy\n @v_netweight = VNetweight.find(params[:id])\n @v_netweight.destroy\n\n respond_to do |format|\n format.html { redirect_to(v_netweights_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @vip_privilege.destroy\n respond_to do |format|\n format.html { redirect_to vip_privileges_url }\n format.json { head :no_content }\n end\n end", "def delete_floating_ip(id)\n check_extension(\"os-floating-ips\")\n @connection.req(\"DELETE\", \"/os-floating-ips/#{id}\")\n true\n end", "def destroy\n @isadiseaseneighbor.destroy\n respond_to do |format|\n format.html { redirect_to isadiseaseneighbors_url, notice: 'Isadiseaseneighbor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @payment_method.destroy\n respond_to do |format|\n flash[:success] = 'Payment method was successfully deleted.'\n format.html { redirect_to admin_payment_methods_url }\n format.json { head :no_content }\n end\n end", "def detach(vpc_id)\n requires :id\n service.detach_internet_gateway(id, vpc_id)\n reload\n end", "def destroy\n go = -> { redirect_to zabbix_servers_url }\n begin\n @zabbix_server.destroy!\n rescue StandardError => ex\n flash[:alert] = ex.message\n go.call and return\n end\n\n ws_send(t('zabbix_servers.msg.deleted', name: @zabbix_server.fqdn), true)\n go.call and return\n end", "def destroy\n @billing_plan = BillingPlan.find(params[:id])\n @billing_plan.destroy\n\n respond_to do |format|\n format.html { redirect_to(billing_plans_url) }\n format.xml { head :ok }\n end\n end", "def delete_virtualization_virtual_network(moid, opts = {})\n delete_virtualization_virtual_network_with_http_info(moid, opts)\n nil\n end", "def delete!\n client.delete_website_push!(website_id, mac: mac?)\n self\n end", "def delete(client, region = 'AWS_REGION')\r\n super\r\n api_id = get_id_for_api(@api_name)\r\n if api_id\r\n options = {\r\n rest_api_id: api_id\r\n }\r\n @client.delete_rest_api(options)\r\n puts \"Deleted API: #{@api_name} ID:#{api_id}\"\r\n else\r\n puts \"API Gateway Object #{@api_name} not found. Nothing to delete.\"\r\n end\r\n true\r\n end", "def destroy\n @billing_address = BillingAddress.find(params[:id])\n @billing_address.destroy\n\n respond_to do |format|\n format.html { redirect_to billing_addresses_url }\n format.json { head :no_content }\n end\n end", "def payment_gateway\n return Spree::BogusGateway.new if ENV['RAILS_ENV'] == \"development\" and Spree::Gateway::Config[:use_bogus]\n\n # retrieve gateway configuration from the database\n gateway_config = GatewayConfiguration.find :first\n config_options = {}\n gateway_config.gateway_option_values.each do |option_value|\n key = option_value.gateway_option.name.to_sym\n config_options[key] = option_value.value\n end\n gateway = gateway_config.gateway.clazz.constantize.new(config_options)\n\n return gateway\n end", "def destroy\n @payment_option = PaymentOption.find(params[:id])\n @payment_option.destroy\n\n respond_to do |format|\n format.html { redirect_to([:admin, @payment_option]) }\n format.xml { head :ok }\n end\n end", "def destroy\n @payment_mode.destroy\n respond_to do |format|\n format.html { redirect_to payment_modes_url }\n format.json { head :no_content }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"#{uri_prefix}/virtual_dns/#{id}\")\n end" ]
[ "0.7183906", "0.7150462", "0.7052538", "0.6931372", "0.6924067", "0.68908215", "0.68870014", "0.66670597", "0.6476776", "0.64290774", "0.6409588", "0.6380826", "0.6116025", "0.6015251", "0.59981155", "0.59282196", "0.57916135", "0.57296383", "0.5694964", "0.56835365", "0.5665611", "0.5626191", "0.5586273", "0.54629683", "0.54291564", "0.5409068", "0.54002815", "0.539045", "0.53833115", "0.5369843", "0.5366484", "0.53582406", "0.535596", "0.5353924", "0.53517497", "0.53517497", "0.5348508", "0.5344589", "0.533565", "0.5334804", "0.5333352", "0.53221565", "0.52777374", "0.5252522", "0.5251643", "0.5244617", "0.5242319", "0.5236539", "0.5231554", "0.52292997", "0.52289283", "0.52232367", "0.52226526", "0.52087677", "0.52025646", "0.519082", "0.5189652", "0.51839846", "0.51659185", "0.5165264", "0.5158724", "0.5155264", "0.5154629", "0.5149284", "0.5139338", "0.5136743", "0.5135756", "0.5133105", "0.51329464", "0.51265156", "0.5125723", "0.51251227", "0.51222914", "0.5113629", "0.5111994", "0.5107056", "0.5106105", "0.5105669", "0.51032495", "0.51029575", "0.51025385", "0.5090392", "0.5081866", "0.50814223", "0.5076188", "0.5067791", "0.50672746", "0.50615937", "0.505948", "0.50555795", "0.50543624", "0.50501305", "0.5036349", "0.5035118", "0.50318825", "0.5028852", "0.502817", "0.50251347", "0.50236624", "0.5021883" ]
0.8243737
0
Delete VPN connection. ec2.delete_vpn_connection("vpna9a643c0") => true
def delete_vpn_connection(vpn_connection_id) link = generate_request("DeleteVpnConnection", 'VpnConnectionId' => vpn_connection_id ) request_info(link, RightHttp2xxParser.new(:logger => @logger)) rescue Exception on_exception end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n requires :vpn_connection_id\n\n service.delete_vpn_connection(vpn_connection_id)\n true\n end", "def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end", "def delete_vpn_gateway(vpn_gateway_id)\n link = generate_request(\"DeleteVpnGateway\", 'VpnGatewayId' => vpn_gateway_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def delete_connection(connection_id)\n raise Auth0::InvalidParameter, 'Must supply a valid connection id' if connection_id.to_s.empty?\n path = \"#{connections_path}/#{connection_id}\"\n delete(path)\n end", "def destroy\n @network_connection = NetworkConnection.find(params[:id])\n @network_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to network_connections_url }\n format.json { head :ok }\n end\n end", "def destroy\n @connection = Connection.find(params[:id])\n @connection.destroy\n\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :ok }\n end\n end", "def deregister_tunnel_connection(connection)\n @tunnel_connections.delete connection.connection_id\n control_connection = connection.control_connection\n @tunnel_connections_by_control[control_connection].delete connection\n end", "def destroy\n @connection.destroy\n respond_to do |format|\n format.html { redirect_to device_interfaces_url(@interface.device), notice: 'Connection was successfully removed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @switchgearconnection = Switchgearconnection.find(params[:id])\n @switchgearconnection.destroy\n redirect_to switchgearconnections_path, :notice => 'Schaltgerätekombination wurde gelöscht.'\n end", "def destroy\n @connection = Connection.find(params[:id])\n @connection.destroy\n\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @connection = Connection.find(params[:id])\n @connection.destroy\n\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :no_content }\n end\n end", "def disconnect(verbose = false)\n\n if File.exists?(@pidfile)\n\n ovpn_pid_from_file = File.read(@pidfile).to_i\n ovpn_pid = get_process_id\n if ovpn_pid != ovpn_pid_from_file\n puts \"Pid file contains PID different to currently running process #{ovpn_pid}\"\n ovpn_pid = ovpn_pid_from_file\n end\n\n else\n ovpn_pid = get_process_id\n end\n\n if ! ovpn_pid.nil?\n begin\n Process.getpgid(ovpn_pid)\n if @interactive\n if agree(\"Disconnect VPN? \", true)\n kill_and_clean(ovpn_pid)\n exit 0\n end\n else\n kill_and_clean(ovpn_pid)\n exit 0\n end\n rescue Errno::ESRCH => e\n puts \"#{ovpn_pid} PROCESS does not exist ... #{e}\"\n if File.exists?(@pidfile)\n File.delete(@pidfile)\n end\n exit 1\n end\n else\n puts \"No OpenVPN process appears to be running\"\n exit 0\n end\n\n end", "def destroy\n @vpn = current_user.vpn\n @vpn.destroy\n\n respond_to do |format|\n format.html { redirect_to dashboard_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @project_connection.destroy\n respond_to do |format|\n format.html { redirect_to project_connections_url, notice: 'Project connection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @connection.destroy\n respond_to do |format|\n format.html { redirect_to connections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @connection.destroy\n respond_to do |format|\n format.html { redirect_to connections_url, notice: \"Connection was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @ps_connection_information.destroy\n respond_to do |format|\n format.html { redirect_to ps_connection_informations_url }\n format.json { head :no_content }\n end\n end", "def delete_pvm_instance(instance_id)\n delete(\"cloud-instances/#{guid}/pvm-instances/#{instance_id}\")\n end", "def rvs_disconnect\n return false unless rvs_key.present?\n rvs_connection.delete('/api-keys/current').status == 200\n end", "def destroy\n @conn = current_user.conns.find(params[:id])\n @conn.destroy\n\n respond_to do |format|\n format.html { redirect_to conns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @route_connection = RouteConnection.find(params[:id])\n @route_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to route_connections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @connection_token.destroy\n respond_to do |format|\n # format.html { redirect_to connections_path, notice: 'Connection was successfully destroyed.' }\n format.json { render json: @connection_token }\n end\n end", "def destroy\n requires :id\n \n service.delete_nat_gateway(id)\n true\n end", "def destroy\n router_bgp('no')\n end", "def destroy\n requires :id\n service.delete_vpc(id)\n true\n end", "def destroy\n connection.close\n end", "def destroy\n @bitbucket2_asana_connection.destroy\n respond_to do |format|\n format.html { redirect_to new_bitbucket2_asana_connection_path, notice: 'Bitbucket2 asana connection was successfully destroyed.' }\n end\n end", "def destroy\n @dbconnection.destroy\n respond_to do |format|\n format.html { redirect_to dbconnections_url, notice: 'Dbconnection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def detach_vpn_gateway(vpn_gateway_id, vpc_id)\n link = generate_request(\"DetachVpnGateway\", 'VpnGatewayId' => vpn_gateway_id,\n 'VpcId' => vpc_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def destroy\n @connpass.destroy\n respond_to do |format|\n format.html { redirect_to connpasses_url, notice: 'Connpass was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_connections(id, connection_name, args = {}, options = {}, &block)\n # Deletes a given connection\n raise AuthenticationError.new(nil, nil, \"Delete requires an access token\") unless access_token\n graph_call(\"#{id}/#{connection_name}\", args, \"delete\", options, &block)\n end", "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def delete(connection)\n connection.delete_vuln_exception(@id)\n end", "def delete(connection)\n connection.delete_vuln_exception(@id)\n end", "def delete_network(name)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_network(name)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "def delete!\n response = @compute.connection.csreq(\"DELETE\",@svrmgmthost,\"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}\",@svrmgmtport,@svrmgmtscheme)\n OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "def destroy\n @http_connection.destroy\n respond_to do |format|\n format.html { redirect_to http_connections_url, notice: \"Http connection was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @missed_connection.destroy\n respond_to do |format|\n format.html { redirect_to missed_connections_url, notice: 'Missed connection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def remove_connection(connection)\n self.connections.delete(connection.id)\n end", "def delete_vpc(vpc_id)\n return if vpc_id.nil? || !configured?\n\n @client.delete_vpc(vpc_id: vpc_id)\n end", "def destroy\n destroy!\n rescue AnsibleTowerClient::Error\n false\n end", "def delete(name)\n @connections.delete(name)\n end", "def destroy_connection\r\n\tbegin\r\n\t\t@sock.close if @sock\r\n\tensure\r\n\t\t@connected=false\r\n\tend\r\n end", "def destroy!\n response = @connection.dbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/instances/#{CloudDB.escape(@id.to_s)}\",@lbmgmtport,@lbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def destroy\n Stripe.api_key = Rails.application.credentials.stripe[Rails.env.to_sym][:secret_key]\n acct = Stripe::Account.retrieve(@connected_account.sid)\n acct.deauthorize(Rails.application.credentials.stripe[Rails.env.to_sym][:client_id])\n @connected_account.destroy\n redirect_to connected_accounts_url, notice: 'Connected account was successfully removed.'\n end", "def destroy\n @t_qconnection.destroy\n respond_to do |format|\n format.html { redirect_to t_qconnections_url, notice: 'T qconnection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_vpc(vpc_id)\n link = generate_request(\"DeleteVpc\", 'VpcId' => vpc_id )\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n rescue Exception\n on_exception\n end", "def destroy\n requires :id\n\n service.delete_internet_gateway(id)\n true\n end", "def delete_private_connection request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_private_connection_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def delete_private_connection request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_private_connection_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def destroy\n @restconnection.destroy\n respond_to do |format|\n format.html { redirect_to restconnections_url, notice: 'Restconnection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def remove(conn)\n @connections.delete conn\n @available.delete conn\n\n release conn.owner\n\n @available.add checkout_new_connection if @available.any_waiting?\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id})\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id)\n end\n end\n end", "def destroy\n @message_phone_connection = MessagePhoneConnection.find(params[:id])\n @message_phone_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to message_phone_connections_url }\n format.json { head :no_content }\n end\n end", "def delete_active_connection\n super\n end", "def disconnect_ssh_tunnel\n @logger.debug('closing SSH tunnel..')\n\n @ssh.shutdown! unless @ssh.nil?\n @ssh = nil\n end", "def delete_vm(instance_id)\n with_thread_name(\"delete_vm(#{instance_id}):v2\") do\n logger.info(\"Deleting instance '#{instance_id}'\")\n @cloud_core.delete_vm(instance_id) do |instance_id|\n @registry.delete_settings(instance_id) if @stemcell_api_version < 2\n end\n end\n end", "def delete_vpc_by_config_id(configuration_id)\n return if configuration_id.nil? || !configured?\n\n vpc = get_vpc_by_config_id(configuration_id)\n delete_vpc(vpc[:vpc_id]) unless vpc.nil?\n end", "def destroy!\n response = @connection.dbreq(\"DELETE\",@dbmgmthost,\"#{@dbmgmtpath}/instances/#{CloudDB.escape(@instance.id.to_s)}/databases/#{CloudDB.escape(@name.to_s)}\",@dbmgmtport,@dbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n true\n end", "def delete\n execute_request { faraday_connection.delete }\n end", "def kill_connection(connection)\n connection.shutdown!\n end", "def destroy\n @connection_group = ConnectionGroup.find(params[:id])\n @connection_group.destroy\n\n respond_to do |format|\n format.html { redirect_to connection_groups_url }\n format.json { head :no_content }\n end\n end", "def delete_vm_instance(name, namespace)\n @conn.vminstances.destroy(name, namespace)\n end", "def delete\n config = get\n return true unless config\n configure(\"no router bgp #{config[:bgp_as]}\")\n end", "def destroy\n @argument_connection = ArgumentConnection.find(params[:id])\n @argument_connection.destroy\n\n respond_to do |format|\n format.html { redirect_to argument_connections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @air_connection.destroy\n respond_to do |format|\n format.html { redirect_to air_connections_url, notice: \"Air connection was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete_tunnel\n super\n end", "def destroy\n @payment_gateway.destroy\n respond_to do |format|\n flash[:success] = 'Payment gateway was successfully deleted.'\n format.html { redirect_to payment_gateways_url }\n format.json { head :no_content }\n end\n end", "def delete_server!(conn, server_name, delete_volumes = false)\n server = conn.servers.find{ |i| i.name == server_name }\n if server\n @log.info \"Deleting instance with name: #{server_name}\"\n # check and delete any floating ip addresses associated with instance\n server.all_addresses.each do |address|\n if address['ip']\n begin\n @log.info \"Disassociating floating ip address associated with instance: #{server.name}\"\n conn.disassociate_address(server.id, address['ip'])\n @log.info \"Releasing floating ip address: #{address['ip']}\"\n conn.release_address(conn.addresses.find {|a| a.ip == address['ip']}.id)\n rescue Exception => ex\n @log.debug \"Error encountered releasing floating ip, reason: #{ex}\"\n # continue\n end\n end\n end\n server.destroy\n if delete_volumes\n volume_service = Fog::Volume::OpenStack.new(\n :openstack_api_key => @os_password,\n :openstack_username => @os_username,\n :openstack_auth_url => @os_auth_url,\n :openstack_tenant => @os_tenant,\n )\n vols_to_del = volume_service.volumes.find{|v| v.display_name =~ /#{server_name}/}\n if vols_to_del\n vols_to_del.each do |vol|\n @log.info \"Waiting for volume to detach from instance: #{server_name}\"\n wait_for_vol(volume_service, vol.id)\n vol.destroy\n end\n else\n @log.info \"No volumes attached for the instance #{server_name}\"\n end\n end\n end\n end", "def destroy\n @instance = @provider.instances.find(params[:id])\n InstanceOperations.terminate_instances(@provider.connect!, @instance)\n @instance.destroy\n redirect_to cloud_provider_path(@provider) \n end", "def destroy\n @findconnection.destroy\n respond_to do |format|\n format.html { redirect_to findconnections_url, notice: 'Findconnection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy(state)\n return if state[:vm_name].nil?\n\n # Reset resource pool, as it's not needed for the destroy action but might be a remnant of earlier calls to \"connect\"\n # Temporary fix until setting cluster + resource_pool at the same time is implemented (lines #64/#187)\n config[:resource_pool] = nil\n\n save_and_validate_parameters\n connect\n\n vm = get_vm(state[:vm_name])\n unless vm.nil?\n vm_api = VSphereAutomation::VCenter::VMApi.new(api_client)\n raise_if_unauthenticated vm_api, \"connecting to VM API\"\n\n # shut the machine down if it is running\n if vm.power_state == \"POWERED_ON\"\n power = VSphereAutomation::VCenter::VmPowerApi.new(api_client)\n power.stop(vm.vm)\n end\n\n # delete the vm\n vm_api.delete(vm.vm)\n end\n end", "def disconnect\n connection { |conn| conn.disconnect }\n true\n end", "def kill(options)\n \n msg = \"kill\"\n cn = nil\n host = nil\n port = nil\n \n # Searching Options\n cn = options[\"CommonName\"] if options.has_key?(\"CommonName\")\n host = options[\"Host\"] if options.has_key?(\"Host\")\n port = options[\"Port\"] if options.has_key?(\"Port\")\n \n if !cn.nil?\n msg.concat(\" #{cn}\")\n @sock.cmd(\"String\" => msg , \"Match\" => /(SUCCESS:.*\\n|ERROR:.*\\n|END.*\\n)/) do |c|\n print c\n end\n else\n if !host.nil? && !port.nil? \n msg.concat(\" #{host}:#{port}\")\n @sock.cmd(\"String\" => msg , \"Match\" => /(SUCCESS:.*\\n|ERROR:.*\\n|END.*\\n)/)\n else \n puts \"Net::OpenVPN Kill Error (Common Name or Host:Port Combination needed)\"\n end\n end\n end", "def destroy\r\n\r\n @connection_request = ConnectionRequest.find(params[:id])\r\n @connection_request.destroy\r\n\r\n render json: {:status => :success, :data => @connection_request}\r\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_payment_gateways_url) }\n format.xml { head :ok }\n end\n end", "def del_ip(vid, ip_address)\n perform_request(:action => 'vserver-delip', :vserverid => vid, :ipaddr => ip_address)\n end", "def destroy\n @payment_gateway = PaymentGateway.find(params[:id])\n @payment_gateway.destroy\n\n respond_to do |format|\n format.html { redirect_to payment_gateways_url }\n format.json { head :ok }\n end\n end", "def destroy\n connection = Connection.find(params[:id])\n group = connection.group\n render json: { success: connection.destroy, group_id: group.id, members_count: group.reload.connections.size, alert_message: I18n.t('connections.alerts.alert', group: group.name) }\n end", "def destroy\n @card_ip.destroy\n end", "def rm_port_connection(port)\n @jcell.remove_port_conn(port)\n end", "def delete_vm\n osapi = Apiexternal::Osapi.new\n\n begin\n osapi.delete_vm(nova_id)\n rescue Exceptions::NextDeployException => me\n me.log\n end\n\n # delete hiera and vcl files\n clear_vmfiles\n generate_host_all\n end", "def release_connection\n conn = @reserved_connections.delete(current_connection_id)\n checkin conn if conn\n end", "def destroy\n @organization_connection.destroy\n respond_to do |format|\n format.html { redirect_to organization_connections_url, notice: 'Organization connection was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def key_pair_deleted?(ec2_client, key_pair_name)\n ec2_client.delete_key_pair(key_name: key_pair_name)\n return true\nrescue StandardError => e\n puts \"Error deleting key pair: #{e.message}\"\n return false\nend", "def delete_connection(relation_name, other_object, bidi)\n return Relation.delete(relation_name, self.node, other_object.node, bidi)\n end", "def delete(connection)\n response = Hpricot.XML(connection.process(Document::Delete.new(self).xml))\n raise Exception, response.at('error').innerHTML if response.at('error')\n self.handle = nil\n self\n end", "def delete_vm\n unless @vm\n info 'No VM assigned, nothing to delete'\n return false\n end\n system(\"knife node delete #{chef_name} -y\")\n # TODO: make changes here after switching to newer version of OpenNebula\n locate_vm(id).finalize\n @vm = nil\n @ip = nil\n true\n end", "def unconfigure_vbox_vm(client_name)\n check_vbox_is_installed()\n exists = check_vbox_vm_exists(client_name)\n if exists == \"no\"\n puts \"VirtualBox VM \"+client_name+\" does not exist\"\n exit\n end\n stop_vbox_vm(client_name)\n sleep(5)\n message = \"Deleting:\\tVirtualBox VM \"+client_name\n command = \"VBoxManage unregistervm #{client_name} --delete\"\n execute_command(message,command)\n return\nend", "def delete_vbox_vm_config(client_name)\n vbox_vm_dir = get_vbox_vm_dir(client_name)\n config_file = vbox_vm_dir+\"/\"+client_name+\".vbox\"\n if File.exist?(config_file)\n message = \"Removing:\\tVirtualbox configuration file \"+config_file\n command = \"rm \\\"#{config_file}\\\"\"\n execute_command(message,command)\n end\n return\nend", "def del_ip(vid, ip_address)\n perform_request(action: 'vserver-delip', vserverid: vid, ipaddr: ip_address)\n end", "def delete(name)\n connect { |connection| connection.delete dn(name) }\n end", "def destroy\n requires :customer_gateway_id\n \n service.delete_customer_gateway(customer_gateway_id)\n true\n end", "def delete_vm(server_id)\n with_thread_name(\"delete_vm(#{server_id})\") do\n @logger.info(\"Deleting server `#{server_id}'...\")\n server = @openstack.with_openstack { @openstack.compute.servers.get(server_id) }\n if server\n server_tags = metadata_to_tags(server.metadata)\n @logger.debug(\"Server tags: `#{server_tags}' found for server #{server_id}\")\n destroy_server(server, server_tags)\n else\n @logger.info(\"Server `#{server_id}' not found. Skipping.\")\n end\n end\n end", "def destroy\n @congress.destroy\n respond_to do |format|\n format.html { redirect_to congresses_url, notice: 'Congress was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(sObjectType, hParams)\n case sObjectType\n when :network\n HPNetwork.delete_network(hParams[:network_connection],\n hParams[:network])\n when :rule\n HPSecurityGroups.delete_rule(hParams[:network_connection],\n hParams[:id])\n obj = hParams[:network_connection]\n obj.security_group_rules.get(hParams[:id]).destroy\n when :server\n required?(hParams, :compute_connection)\n required?(hParams, :server)\n HPCompute.delete_server(hParams[:compute_connection],\n hParams[:server])\n end\n end", "def vpn_down\n vpn_sw = params[:vpn_sw]\n vpn_status = VpnStatus.DOWN\n Node.all.each do |node|\n node.update_vpn_status vpn_status,\"0.0.0.0\",vpn_sw\n end\n render status: :created, :text => \"\"\n end", "def delete_pg\n pg_name = self['BRIDGE']\n sw_name = self['TEMPLATE/VCENTER_SWITCH_NAME']\n\n raise \"Missing BRIDGE from VNET template\" if pg_name.empty?\n raise \"Missing VCENTER_SWTICH_NAME from VNET template\" if sw_name.empty?\n\n errors = []\n\n #-----------------------------------------------------------------------\n # Iterate over all clusters and hosts to remove PG\n #-----------------------------------------------------------------------\n @clusters.each do |cluster|\n cli = cluster[:cli]\n\n cluster[:ccr]['host'].each do |host|\n begin\n esx = VCenterDriver::ESXHost.new_from_ref(host._ref, cli)\n\n next unless esx.pg_exists(pg_name)\n\n sw = esx.remove_pg(pg_name)\n\n next if !sw || sw_name != sw\n\n vswitch = esx.vss_exists(sw_name)\n next unless vswitch\n\n # Remove switch if the port group being removed is the last one\n esx.remove_vss(sw_name) if vswitch.portgroup.empty?\n\n rescue StandardError => e\n msg = \"\\tHost #{esx._ref}. Reason: \\\"#{e.message}\\\".\\n\"\n msg << \"#{e.backtrace}\\n\" if @debug\n\n errors << msg\n end\n end\n end\n\n #-----------------------------------------------------------------------\n # Notify error on PG removal error\n #-----------------------------------------------------------------------\n unless errors.empty?\n message = \"Error deleting port group from hosts:\\n\"\n message << errors.join\n\n raise message\n end\n end", "def remove_and_close(connection)\n @connections.delete(connection)\n close_connection(connection)\n end", "def delete(connection)\n @streams[connection.class.to_s].delete(connection)\n end" ]
[ "0.8566948", "0.6577365", "0.6408355", "0.6338869", "0.6139732", "0.6011228", "0.6007342", "0.59931576", "0.5975029", "0.5954041", "0.5954041", "0.593591", "0.5904912", "0.5869909", "0.5847338", "0.58333385", "0.58041346", "0.579174", "0.5732727", "0.57266825", "0.5715345", "0.5675243", "0.566455", "0.5659062", "0.5648052", "0.5644933", "0.5622812", "0.55871046", "0.55387115", "0.55375606", "0.54822344", "0.54183364", "0.5415742", "0.5415742", "0.5403344", "0.5398756", "0.5395117", "0.5390244", "0.53830457", "0.53720677", "0.5371852", "0.5369729", "0.5362469", "0.5359513", "0.5357567", "0.53556246", "0.5341253", "0.5340729", "0.5302494", "0.5302494", "0.5301323", "0.5295142", "0.5291583", "0.5288996", "0.5286486", "0.52794904", "0.52667165", "0.5261138", "0.52513814", "0.5247897", "0.52373314", "0.5215833", "0.5208744", "0.5202943", "0.51992446", "0.5199118", "0.5198517", "0.5197959", "0.5194676", "0.51895887", "0.5187929", "0.5182948", "0.51823163", "0.5181339", "0.51780874", "0.5164886", "0.516285", "0.5161472", "0.515705", "0.5155108", "0.5140796", "0.5135626", "0.5122682", "0.51144725", "0.5114199", "0.51084256", "0.51075375", "0.5107038", "0.51069576", "0.5100997", "0.5095274", "0.5094581", "0.5093419", "0.5086244", "0.5081895", "0.50753284", "0.50742", "0.50741625", "0.5073568", "0.5070714" ]
0.7710807
1
needed this method, it is a bit of a hack
def each self.to_hash.each end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def original; end", "def wrapper; end", "def custom; end", "def custom; end", "def escaper; end", "def weber; end", "def internal; end", "def anchored; end", "def refutal()\n end", "def isolated; end", "def isolated; end", "def original_result; end", "def extra; end", "def suivre; end", "def implementation; end", "def implementation; end", "def terpene; end", "def escaper=(_); end", "def identify; end", "def offences_by; end", "def extended(*) end", "def berlioz; end", "def formation; end", "def handle; end", "def sitemaps; end", "def overrides; end", "def probers=(_arg0); end", "def ignores; end", "def trd; end", "def origin; end", "def origin; end", "def origin; end", "def same; end", "def placebo?; false end", "def post_process; end", "def processor; end", "def prepareForReuse; end", "def transform; end", "def ext=(_arg0); end", "def ext=(_arg0); end", "def ext=(_arg0); end", "def transforms; end", "def bs; end", "def from; end", "def from; end", "def from; end", "def from; end", "def transformations; end", "def verdi; end", "def offences_by=(_arg0); end", "def used?; end", "def expanded; end", "def internship_passed; end", "def zuruecksetzen()\n end", "def rest_positionals; end", "def rassoc(p0) end", "def stderrs; end", "def ibu; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def next() end", "def next() end", "def ext; end", "def ext; end", "def tell()\n #This is a stub, used for indexing\n end", "def intensifier; end", "def extra=(_arg0); end", "def operations; end", "def operations; end", "def pausable; end", "def r; end", "def r; end", "def private_method\n end", "def loc; end", "def loc; end", "def loc; end", "def origin=(_arg0); end", "def celebration; end", "def implemented_in; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def internal?; end" ]
[ "0.7332386", "0.6274376", "0.6181776", "0.6181776", "0.6181776", "0.6181776", "0.61147016", "0.58904445", "0.58735126", "0.5859788", "0.5859788", "0.5730424", "0.5706505", "0.5698918", "0.56872684", "0.56723124", "0.5649386", "0.5649386", "0.5644264", "0.5642484", "0.56346774", "0.5624243", "0.5624243", "0.55727935", "0.5547119", "0.55425304", "0.55160975", "0.5512229", "0.5497298", "0.5464808", "0.5450344", "0.5426049", "0.5420341", "0.5403393", "0.5383461", "0.53764045", "0.5330426", "0.5330426", "0.5330426", "0.53245044", "0.532204", "0.5316043", "0.5315923", "0.5304823", "0.5302658", "0.52961636", "0.52961636", "0.52961636", "0.52930063", "0.5291583", "0.5277584", "0.5277584", "0.5277584", "0.5277584", "0.52563566", "0.52497876", "0.5243483", "0.52333534", "0.5232324", "0.5219661", "0.5219573", "0.52142733", "0.52107334", "0.5201672", "0.5200732", "0.519728", "0.519728", "0.519728", "0.519728", "0.519728", "0.519728", "0.519728", "0.519728", "0.5195932", "0.5195932", "0.5193602", "0.5193602", "0.51853293", "0.5184526", "0.5177505", "0.5175334", "0.5175334", "0.5173008", "0.51703805", "0.51703805", "0.51699907", "0.5164556", "0.5164556", "0.5164556", "0.5155037", "0.5143924", "0.51417106", "0.51387817", "0.51387817", "0.51387817", "0.51387817", "0.51387817", "0.51387817", "0.51387817", "0.51387817", "0.5135742" ]
0.0
-1
prime numbers only divisible by themselves and 1 modulo will be != 0 for everything but themselves and 1
def prime?(num) fail_count = 0 if num < 0 num = num * (-1) end factors = [] range = (1..num) range.each do |range_number| remain = num % range_number if remain == 0 factors.push(num) else fail_count += 1 end end puts fail_count if factors[-1] == 1 return false elsif num == 0 return false elsif factors.count > 2 return false elsif factors.count == 2 return true else return nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prime_alt_1(number)\n return false if number <=1\n max_div = Math.sqrt(number)\n (2..max_div ).each do |x|\n if (number % x)== 0\n return false\n end\n end\n return true\nend", "def prime?(num) \n return false if !num.integer? #integer is # that is not a fraction\n return false if num < 2\n return true if num == 2\n (2..num-1).each {|int| return false if num % int == 0}\n true\nend", "def is_prime?(num)\n if !num.is_a?(Integer) || ( num.class == Float && !num.nan? && num == num.floor ) || num <= 1\n false\n else\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n true\n end\nend", "def PrimeNumber?(number)\n return false if number<2 || number%2 ==0\n (3..number-1).select(&:odd?).each do |i|\n return false if number%i == 0\n end\n true\nend", "def anti_prime?(number)\n divisor_count = divisors(number)\n (2..number).each do |num| \n return false if divisors(num) > divisor_count \n end \n true\nend", "def anti_prime?(num)\n counter = count_divisors(num)\n counters = []\n \n (1...num).each do |i|\n if i.even? #unnecessary to add .even\n counters << count_divisors(i)\n end\n end\n counters.each do |c| \n if c > counter\n return false\n end\n end\n true\nend", "def check_prime? n \nn_max_two=Math.sqrt(n).floor \nnot_count=0 \nfor i in 2..n_max_two\n if n % i == 0 \nnot_count +=1 \n end \nend \nif not_count > 0 \n return false \n else \n return true \nend \nend", "def is_prime?(num)\n return false if num.even?\n for i in (2..((num/2.round) + 1))\n return false if num % i == 0\n end\n return true\nend", "def is_prime?(num)\n return false if num.even?\n for i in (2..((num/2.round) + 1))\n return false if num % i == 0\n end\n return true\nend", "def is_prime?(num)\n if !is_integer?(num)\n return false\n elsif num <= 1\n return false\n else\n (2..(num-1)).each do |el|\n if num % el == 0\n return false\n end\n end\n end\n return true\nend", "def is_prime?(number)\n (2...number).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\n \nend", "def is_prime?(number)\n (2..(number - 1)).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\nend", "def is_prime?(number)\n (2..(number - 1)).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\nend", "def is_prime?(number)\n (2..(number - 1)).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\nend", "def is_prime?(number)\n remainders = (2...number).map { |d| number % d}\n !remainders.include?(0) && number > 1\nend", "def is_prime?(number)\n divided_by = number - 1\n while divided_by > 1\n if number % divided_by == 0\n return false\n end\n divided_by -= 1\n end\n return true\nend", "def divisible_by number, divisor\n number % divisor == 0\n end", "def anti_prime?(num)\n num_divisors = divisors(num).length\n\n (1..num).each do |div|\n return false if divisors(div).length > num_divisors\n end\n \n return true\nend", "def prime?(number)\n # binding.pry\n return false if number < 2\n (2..number - 1 ).each do|num|\n if (number % num) == 0\n return false\n end\n end\n true\nend", "def is_prime_number(num)\n (2...num).all? {|n| num % n != 0}# has factors\nend", "def is_prime?(number)\n return false if number < 2\n \n (2..number - 1).each do |n|\n return false if number % n == 0\n end\n\n true\nend", "def is_prime?(number)\n idx = 2\n if number < 2\n return false\n end\n\n while idx <= number**0.5\n return false if number%idx == 0\n idx+=1\n end\n return true\nend", "def is_prime?(f) \n !(2..(f**0.5)).any? {|div| f%div==0 }\nend", "def prim value\n for i in 2..(value - 1)\n if value % i == 0 \n return 0\n end\n end\n \n return 1\nend", "def is_prime?(num)\n (2..(num/2)).each { |divisor| return false if num % divisor == 0 }\n true\nend", "def is_prime?(number)\n (2...number).each do |factor|\n if number % factor == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n (2..(num - 1)).each do |divisor|\n return false if num % divisor == 0\n end\n\n true\nend", "def is_prime(num)\n (2..num**0.5).each { |i| return false if num % i == 0 }\n true\nend", "def is_prime?(num)\n i = 2\n while i < num\n divisible = ((num % i) == 0)\n if divisible\n return false\n end\n i += 1\n end\n true\nend", "def is_prime(test_number)\n j=2\n while j<test_number-1 do\n if test_number%j==0\n test_number=0\n end\n j=j+1\n end\n test_number=test_number\nend", "def prime?(num)\n if num == 2\n true\n elsif num > 1 && num % num == 0 && num % 1 == 0 && !(2 .. (num - 1)).to_a.any?{|number| num % number == 0}\n true\n else\n false\n end\nend", "def is_prime?(num)\n return false if num < 2\n\n (2...num).each do |i|\n return false if num % i == 0\n end\n true \nend", "def prime?(number)\n return false if number < 2\n (2..number - 1).each do |x|\n if (number % x) == 0\n return false\n end\n end\n true\nend", "def prime?(num)\n return false if num <= 1 \n (1..num-1).each {|n| return false if (((n**num)-num)%num == 0) }\n true\nend", "def is_prime?(num)\n Math.sqrt(num).floor.downto(2).each do |i|\n false if num % i == 0\n end\n true\nend", "def is_prime(num)\n (2..Math.sqrt(num).floor).each do |i|\n if num % i == 0\n return false\n end\n end\n return true\nend", "def prime?(num)\n return false if num < 2\n (2..num - 1).each { |div| return false if num % div == 0 }\n true\nend", "def is_prime?(num)\n return false if num == 1\n return true if num == 2 \n (2..Math.sqrt(num)+1).each do |x|\n return false if num%x == 0\n end\n true\nend", "def is_prime?(num)\n return false if num <= 1\n\n (2...num).each do |fact|\n return false if num % fact == 0\n end\n\n true\nend", "def is_prime?(number)\n if number <= 1\n return false\n end\n\n i = 2\n while i < number\n if (number % i) == 0\n return false\n end\n i += 1\n end\n return true\nend", "def prime?(num)\n return true if num == 1 || num == 2\n return false if num % 2 == 0\n\n divisor = 3\n while divisor <= num**0.5\n return false if num % divisor == 0\n divisor += 2\n end\n true\nend", "def prime?(num)\n return false if num <= 1\n for i in (2..num - 1)\n return false if num.to_f % i == 0\n end\n true\nend", "def prime?(int)\n if int < 0 || int == 0 || int == 1 \n return false \n\n else\n (2...int).to_a.all? {|num| int % num != 0}\n\n end\nend", "def is_prime?(num)\n (2..num-1).each do |x|\n return false if num % x == 0\n end\n true\nend", "def is_prime(number)\n if number == 1\n return true\n end\n 2.upto(number) do |x|\n if (number % x == 0) && (number != x)\n return false\n end\n end\n return true\nend", "def prime?(num)\n # byebug\n return false if num < 2\n\n (2...(num)).each do |factor|\n if num % factor == 0\n return false\n end\n end\n true\nend", "def is_prime?(num)\n for i in (2...num/2)\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime?(n)\n return false if n == 1\n (2..n-1).each do |divisor|\n return false if n % divisor == 0\n end\n true\nend", "def is_prime?(num)\n # Write your code here\n # (1..num).select { |element| num % element == 0 }.length == 2 ? true : false\n\n return false if num < 2\n\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n return true\nend", "def is_prime?(integer)\n return false if integer == 1\n (2...integer).to_a.all? {|num| integer % num != 0}\nend", "def is_prime(num)\r\n div=2\r\n while(div*div<=num)\r\n if(num%div==0)\r\n return false;\r\n end \r\n div=div+1;\r\n end \r\n return true;\r\nend", "def prime?(number)\n a = []\n n = (2...number).to_a\n if number == 1 || number == 0 || number.negative?\n false\n else\n n.collect {|x| a << number % x}\n if a.include?(0)\n false\n else\n true\n end\n end\n # (2...number).to_a.each {|x| (number/x).integer? ? false : true}\nend", "def prime?(arg)\nreturn false if arg <= 1\nreturn true if arg == 2\n result = true\n (3..arg).to_a.each_with_index{|num, idx|result = false if arg % (idx+1) == 0 && (idx+1) != 1}\n result\nend", "def prime?(num)\n return false if num == 1\n return true if num == 2 or num == 3 or num == 5 or num == 7\n return false if num % 2 == 0 or num % 3 == 0 or num % 5 == 0 or num % 7 == 0\n (11..Math.sqrt(num).ceil).each do |i| \n return false if num % i == 0\n end\n true \nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime? (number)\n return false if number < 1\n 2.upto(Math.sqrt(number)) do |x|\n return false if number % x == 0\n end \n true\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each do |i|\n return false if num%i == 0\n end\n return true\nend", "def prime?(num)\n if num < 2\n return false\n end\n\n (2...num).each do |divisor| \n if num % divisor == 0\n return false\n end\n end\n\n return true\nend", "def is_prime?(x)\n return false if x == 1\n return true if x == 2 || x == 3\n return false if x % 2 == 0 || x % 3 == 0\n limit = (x ** (1/2.0)).to_i\n i = 1\n a = 6*i - 1\n b = 6*i + 1\n\n while a <= limit || b <= limit\n return false if x % a == 0 || x % b == 0\n i += 1\n a = 6*i - 1\n b = 6*i + 1\n end\n\n return true\nend", "def prime?(num)\n return false if num < 2\n\n i = 2\n while i <= num / i\n return false if num % i == 0\n i += 1\n end\n\n true\nend", "def is_prime?(num)\n (2...num).each {|el| return false if num % el == 0}\n true\nend", "def is_prime?(num)\n return 2 if num == 2\n (2...num).each do |n|\n return false if num % n == 0\n end\n true\nend", "def anti_prime?(num)\n divisor_count = num_factors(num)\n\n (1...num).each do |n|\n return false if num_factors(n) > divisor_count\n end\n return true\nend", "def not_prime?(num)\n 2.upto(num - 1) do |number|\n return true if num % number == 0\n end\n false\nend", "def prime?(num)\n return false if num == 1\n (2...num).each do |number|\n return false if num % number == 0\n end\n return true\nend", "def is_prime?(num)\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n true\nend", "def prime?(number)\n if number < 2\n return false\n else\n (2..number-1).each do |n|\n if number % n == 0\n return false\n end\n end\n true\nend\nend", "def is_prime?(num)\n (2..num / 2).each do |n|\n return false if num % n == 0\n end\n true\nend", "def isprime?(num)\n\n return false if num<2\n\n (2...num).each do |factor|\n return false if num % factor == 0\n end\n\n return true\n\nend", "def is_prime?(num)\n return false if num < 2\n \n (2...num).each do |i|\n return false if num % i == 0\n end\n true\nend", "def is_prime?(x)\r\n if x == 1\r\n return false\r\n end\r\n for n in (1..Math.sqrt(x).ceil)\r\n if x%n == 0 \r\n if n != 1 && n != x\r\n return false\r\n end\r\n end\r\n end\r\n return true\r\nend", "def prime?(num)\n return false if num < 2\n\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n\n true\nend", "def is_prime?(n)\n end", "def prime?(value)\n if value <= 1 || value == 0# || #value == 1\n return false\n elsif\n (2..value - 1).each do |i|\n if value % i == 0\n return false\n end\n end\n end\n true # <= need explanation\nend", "def prime?(integer)\n denominators = (2..integer - 1).to_a \n if integer < 2\n false \n else \n !(denominators.any? do |denominator| \n integer % denominator == 0\n end)\n end\nend", "def is_prime?(number)\n return false if number < 2\n (2...number).to_a.none?{ |integer| number % integer == 0 }\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each { |factor| return false if num % factor == 0}\n true\nend", "def prime?(number)\n if number == 0 or number == 1\n return false\n end\n i = 2\n while i < number\n if number % i == 0\n return false\n end\n i += 1\n end\n return true\nend", "def is_prime?(number)\n i = number - 1\n until i < 2\n if number % i == 0\n return false\n end\n i -= 1\n end\n return true\nend", "def prime?(num)\n return false if num <= 1\n for i in 2..num/2\n if num % i == 0\n return false\n end\n end\n true\nend", "def is_prime?(number)\n counter = 0 \n (2..(number-1)).each do |num|\n if ( number % num ) == 0\n counter += 1\n else\n counter = counter\n end \n end \n \n if counter > 0 \n return false\n else \n return true\n end \n \nend", "def is_prime?(num)\n\n return false if num <= 1\n return true if num == 2\n\n i = 2\n while i < num\n return false if num % i == 0\n i += 1\n end\n\n true\n\nend", "def is_prime?(num)\n (2...num).each do |el|\n return false if num % el == 0\n end\n true\nend", "def is_prime?(num)\n (2...num).none? { |div| num % div == 0 }\nend", "def is_prime?(num)\n return false if num <= 1\n\n idx = 2\n while idx < num\n if num % idx == 0\n return false\n end\n idx += 1\n end\n\n true\nend", "def prime?(num)\n if num < 2\n return false\n end\n\n (2...num).each do |el|\n if num % el == 0\n return false\n end\n end\n true\nend", "def prime?(num)\n return false if num < 2\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n true\nend", "def prime(next_number, primes)\n primes.each do |prime|\n return false if next_number % prime == 0\n end\n return true\nend", "def prime?(number)\n (2..(number-1)).each do |possible_factor|\n return false if number % possible_factor == 0\n end\n true\nend", "def is_prime?(num)\n if num < 2\n return false\n end\n\n idx = 2\n while idx < num\n if num % idx == 0\n return false\n end\n idx += 1\n end\n true\nend", "def isprime(n)\n \n for x in (3..(n**0.5).abs+2)\n if n % x == 0\n return false\n end\n return true\n end\nend", "def isPrime(num)\n (2..(num / 2)).each { |i|\n if (num % i == 0)\n return false\n end\n }\n true\nend", "def isPrime(num)\nreturn false if num < 2\n(2..(Math.sqrt(num))).each do |x|\n return false if num % x == 0\nend\ntrue\nend", "def is_prime? n3\n if !is_integer?(n3) || n3 <= 1\n false\n else\n (2..(n3-1)).each do |i|\n if n3 % i == 0\n return false\n end\n end\n true\n end\nend", "def prime?(num)\n if num < 2\n return false\n elsif num == 2\n return true\n end\n\n (2...num).each do |n|\n if num % n == 0\n return false\n end\n end\n true\nend", "def is_prime?(number)\n number = number.abs\n return false if number < 2\n return true if number < 4\n\n factor = 2\n while factor * factor <= number\n return false if number % factor == 0\n factor += 1\n end\n\n true\nend", "def is_prime?(number)\n number = number.abs\n return false if number < 2\n return true if number < 4\n\n factor = 2\n while factor * factor <= number\n return false if number % factor == 0\n factor += 1\n end\n\n true\nend", "def is_prime?(number)\n number = number.abs\n return false if number < 2\n return true if number < 4\n\n factor = 2\n while factor * factor <= number\n return false if number % factor == 0\n factor += 1\n end\n\n true\nend", "def prime?(num)\n return false if num == 1\n return true if num == 2\n (2...num).each do |divisor|\n return false if num % divisor == 0\n end\n true\nend", "def isPrime?(num)\n return false if num < 2\n\n (2...num).each { |factor| return false if num % factor == 0}\n\n true\nend" ]
[ "0.7799592", "0.7716491", "0.76884675", "0.76285803", "0.76052797", "0.75964946", "0.7533037", "0.75246763", "0.75246763", "0.7505941", "0.74972594", "0.7494623", "0.7494623", "0.7494623", "0.74922144", "0.7483564", "0.7482918", "0.74609315", "0.74240124", "0.7419909", "0.7419176", "0.7414987", "0.74149466", "0.7395268", "0.73823357", "0.73823285", "0.7377636", "0.7375016", "0.7369812", "0.73692304", "0.7358232", "0.7353542", "0.7353134", "0.73523116", "0.7350431", "0.7350227", "0.7347184", "0.734447", "0.7340407", "0.7324839", "0.73202276", "0.73200595", "0.73182267", "0.73177266", "0.7316308", "0.73160374", "0.73157674", "0.7312221", "0.7311508", "0.73087573", "0.73053247", "0.73042744", "0.73021775", "0.73014086", "0.7299555", "0.7299504", "0.7299014", "0.7298982", "0.72971547", "0.7295822", "0.72949636", "0.7292648", "0.72914004", "0.7291375", "0.72911733", "0.72901154", "0.72888637", "0.7286442", "0.7284736", "0.72818476", "0.72804517", "0.72797024", "0.72795147", "0.7279074", "0.7278667", "0.72766507", "0.72756535", "0.72754157", "0.7274728", "0.7273748", "0.7270758", "0.72703135", "0.72693115", "0.7269153", "0.726881", "0.72671485", "0.7265658", "0.7264243", "0.72638", "0.72627646", "0.72606707", "0.7260416", "0.7258067", "0.7257088", "0.72545", "0.7248951", "0.7247902", "0.7247902", "0.7247902", "0.7246624", "0.72441065" ]
0.0
-1
Generate expected cookbook version hash
def batali_cookbook_hash Chef::Log.warn 'Resolving cookbooks via Batali!' system = batali_build_system constraints = Smash[ api_service.get_rest("environments/#{node.chef_environment}").cookbook_versions.to_a ] restrictions = api_service.get_rest("environments/#{node.chef_environment}").cookbook_versions.to_a requirements = Array.new.tap do |reqs| @expanded_run_list_with_versions.each do |item| c_name, c_version = item.split('@') c_name = c_name.split('::').first reqs << [c_name, c_version ? c_version : '> 0'] end end unless(requirements.empty?) solver = Grimoire::Solver.new( :requirements => Grimoire::RequirementList.new( :name => 'requirements', :requirements => requirements ), :restrictions => Grimoire::RequirementList.new( :name => 'restrictions', :requirements => restrictions ), :system => system, :score_keeper => batali_build_score_keeper ) results = solver.generate! solution = results.pop solution_output = solution.units.sort_by(&:name).map{|u| "#{u.name}<#{u.version}>"}.join(', ') node.set[:batali] ||= Mash.new node.set[:batali][:last_resolution] = Mash[solution.units.map{|u| [u.name, u.version]}] Chef::Log.warn "Batali cookbook resolution: #{solution_output}" Hash[ solution.units.map do |unit| [unit.name, api_service.get_rest("cookbooks/#{unit.name}/#{unit.version}")] end ] else node.set[:batali][:last_resolution] = Mash.new Chef::Log.warn 'Batali resolution not required. No cookbooks in run list!' Hash.new end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aws_cookbook_version\n aws_version = run_context.cookbook_collection['aws'].metadata.version.chomp('v')\n end", "def version_guid\n \"#{digest_type}:#{checksum}\"\n end", "def check_commit_version\n metadata = Chef::Cookbook::Metadata.new\n metadata.from_file(File.join(Config.settings['jenkins']['workspace_dir'], 'cookbooks', @cookbook, 'metadata.rb'))\n metadata.version\n end", "def hash\n name.hash ^ version.hash\n end", "def version\n @version ||= version_hex.to_s(16).chars.entries.join('.')\n end", "def test\n commit_v = check_commit_version\n serv_v = check_server_version\n updated = Gem::Version.new(serv_v) < Gem::Version.new(commit_v)\n\n puts \"Running cookbook version rev'd test:\"\n puts \"Server version: #{serv_v}\".indent\n puts \"Commit version: #{commit_v}\".indent\n puts updated ? \"PASS: Metadata version has been rev'd\".indent : \"FAIL: Metadata version has NOT been rev'd\".indent.to_red\n updated\n end", "def current_version\n node['chef_packages']['chef']['version']\nend", "def current_version\n node['chef_packages']['chef']['version']\nend", "def version(arg = nil)\n if arg\n @version = Chef::Version.new(arg)\n end\n\n @version.to_s\n end", "def cookbook_version(name = nil)\n cookbook = name.nil? ? cookbook_name : name\n node.run_context.cookbook_collection[cookbook].metadata.version\n end", "def version_id\n \"#{size}+#{timestamp}-#{md5}\"\n end", "def version_hex\n @version_hex ||= control_transfer(function: :version, dataIn: 1).unpack('c').first\n end", "def set_cookbook_version(version)\n return unless get_cookbook_version() != version\n contents = ''\n cookbook_path = get_cookbook_path(@cookbook_name)\n File.foreach(\"#{cookbook_path}/metadata.rb\") do |line|\n line.gsub!(/(version[\\t\\s]+)(.*)/i,\"\\\\1 \\\"#{version}\\\"\\n\")\n contents = contents << line\n end\n File.open(\"#{cookbook_path}/metadata.rb\", 'w') {|f| f.write(contents) }\n return true\n end", "def package_name\n ver = if new_resource.version == 'latest'\n package_metadata[:version]\n else\n new_resource.version\n end\n \"Chef Development Kit v#{ver}\"\n end", "def company_cookbook(name, version = '>= 0.0.0', options = {})\n cookbook(name, version, { git: \"https://github.com/EagleGenomics-cookbooks/#{name}.git\" }.merge(options))\nend", "def binary_version; end", "def chef_version\n v = run_command('sudo chef-solo --version').stdout.split(':')\n v[0].strip == 'Chef' ? v[1].strip : ''\n end", "def chef_version\n # SPEC_BLOCK_CI is used to force non-locking behavior inside tests.\n @chef_version ||= ENV['CHEF_VERSION'] || if ENV['POISE_MASTER_BUILD']\n # We're going to install the latest nightly via Omnitruck later on.\n nil\n elsif ENV['SPEC_BLOCK_CI'] != 'true'\n # If there isn't a specific override, lock TK to use the same version of Chef as the Gemfile.\n require 'chef/version'\n Chef::VERSION.to_s\n end\n end", "def required_version\n fetch(:chef_version) || nil\n end", "def canonical_revision_string\n canonical_rev_text = \"\"\n\n canonical_rev_text << \"name:#{name}\\n\"\n\n run_list.each do |item|\n canonical_rev_text << \"run-list-item:#{item}\\n\"\n end\n\n named_run_lists.each do |name, run_list|\n run_list.each do |item|\n canonical_rev_text << \"named-run-list:#{name};run-list-item:#{item}\\n\"\n end\n end\n\n cookbook_locks_for_lockfile.each do |name, lock|\n canonical_rev_text << \"cookbook:#{name};id:#{lock[\"identifier\"]}\\n\"\n end\n\n canonical_rev_text\n end", "def version_to_install\n return config[:bootstrap_version] if config[:bootstrap_version]\n\n if config[:channel] == \"stable\"\n Chef::VERSION.split(\".\").first\n else\n \"latest\"\n end\n end", "def version\n build_string\n end", "def build_version\n @semver.to_s '%M.%m.%p'\n end", "def get_cookbook_version(path)\n metadata = load_metadata(path)\n metadata.version\n end", "def store_version\n path = 'lib/bootstrap/version.rb'\n content = File.read(path).sub(/BOOTSTRAP_SHA\\s*=\\s*['\"][^'\"]*['\"]/, \"BOOTSTRAP_SHA = '#@branch_sha'\")\n File.open(path, 'w') { |f| f.write(content) }\n end", "def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end", "def external_dependency_checksum; end", "def installed_version\n capture(\"#{chef_solo} -v || true\") =~ /Chef: (\\d+\\.\\d+\\.\\d+)/ ? $1 : nil\n end", "def version\n @gemspec.version || @version_helper.to_s\n end", "def run_version\n run result: ::Kitchen::Terraform::Client::Command.version(working_directory: config.fetch(:kitchen_root))\n end", "def version\n spec.version\n end", "def consistent_hash\n Zlib.crc32(self.to_yaml, 0)\n end", "def digest\n @digest ||= Digest::SHA1.new.update(version.to_s)\n @digest.dup\n end", "def expected_for_cookbooks(cookbooks, num_versions)\n latest = get_latest_cookbooks(cookbooks, num_versions)\n latest.inject({}) do |body, cookbook_spec|\n name, version_specs = cookbook_spec\n body[name] = {\n \"url\" => api_url(\"/cookbooks/#{name}\"),\n \"versions\" => version_specs.map do |version_string, recipe_names|\n {\n \"url\" => api_url(\"/cookbooks/#{name}/#{version_string}\"),\n \"version\" => version_string\n }\n end\n }\n body\n end\n end", "def expected_digest\n hash = {\n 'class' => 'CourseDataUpdateWorker',\n 'queue' => queue_for(@course),\n 'unique_args' => [@course_id]\n }.to_json\n digest = OpenSSL::Digest::MD5.hexdigest hash\n \"uniquejobs:#{digest}\"\n end", "def set_cookbook_attribute\n run_context.cookbook_collection.each do |cookbook_name, cookbook|\n automatic_attrs[:cookbooks][cookbook_name][:version] = cookbook.version\n end\n end", "def koi_version\n version_file_path = self.rails_template[/.*(?=templates)/]\n version_file_path += 'koi/version.rb'\n version_data = open(version_file_path) {|f| f.read }\n\n version = version_data.split(\"\\n\")[1].split('=').last.strip.gsub(/\\\"/, '')\nend", "def parsed_version\n return \"~\\\"#{new_resource.version}\\\"\" if new_resource.version\n ''\n end", "def update_necessary?\n load_mixlib_versioning\n cur_version = Mixlib::Versioning.parse(current_version)\n des_version = Mixlib::Versioning.parse(desired_version)\n Chef::Log.debug(\"The current chef-client version is #{cur_version} and the desired version is #{desired_version}\")\n new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version)\nend", "def productVersion \n \"productVersion\" \n end", "def generate_pact_version_sha json_content\n PactBroker.configuration.sha_generator.call(json_content)\n end", "def digest\n @digest ||= begin\n Digest::SHA1.hexdigest \"defaults-#{NilavuStylesheets.last_file_updated}\"\n end\n end", "def target_chef_version(version)\n RuboCop::Config.new('AllCops' => { 'TargetChefVersion' => version })\nend", "def target_chef_version(version)\n RuboCop::Config.new('AllCops' => { 'TargetChefVersion' => version })\nend", "def installed_chef_version\n return @installed_chef_version if @installed_chef_version\n\n # Note: In the case of a very old version of chef (that has no manifest - pre 12.0?)\n # this will report as not installed.\n manifest = read_chef_version_manifest\n\n # We split the version here because unstable builds install from)\n # are in the form \"Major.Minor.Build+HASH\" which is not a valid\n # version string.\n @installed_chef_version = Gem::Version.new(manifest[\"build_version\"].split(\"+\")[0])\n end", "def component_version(exec)\n cmd = \"#{exec} --version\"\n po = Puppet::Util::Execution.execute(cmd, combine: false)\n raise \"Exit #{po.exitstatus} running #{cmd.join(' ')}. STDOUT: #{po}\" if po.exitstatus != 0\n\n po.strip\n end", "def to_ruby\n mark_version\n result = []\n result << \"# -*- encoding: utf-8 -*-\"\n result << \"#{Gem::StubSpecification::PREFIX}#{name} #{version} #{platform} #{raw_require_paths.join(\"\\0\")}\"\n result << \"#{Gem::StubSpecification::PREFIX}#{extensions.join \"\\0\"}\" unless\n extensions.empty?\n result << nil\n result << \"Gem::Specification.new do |s|\"\n\n result << \" s.name = #{ruby_code name}\"\n result << \" s.version = #{ruby_code version}\"\n unless platform.nil? or platform == Gem::Platform::RUBY\n result << \" s.platform = #{ruby_code original_platform}\"\n end\n result << \"\"\n result << \" s.required_rubygems_version = #{ruby_code required_rubygems_version} if s.respond_to? :required_rubygems_version=\"\n\n if metadata and !metadata.empty?\n result << \" s.metadata = #{ruby_code metadata} if s.respond_to? :metadata=\"\n end\n result << \" s.require_paths = #{ruby_code raw_require_paths}\"\n\n handled = [\n :dependencies,\n :name,\n :platform,\n :require_paths,\n :required_rubygems_version,\n :specification_version,\n :version,\n :has_rdoc,\n :default_executable,\n :metadata,\n :signing_key,\n ]\n\n @@attributes.each do |attr_name|\n next if handled.include? attr_name\n current_value = self.send(attr_name)\n if current_value != default_value(attr_name) || self.class.required_attribute?(attr_name)\n result << \" s.#{attr_name} = #{ruby_code current_value}\"\n end\n end\n\n if String === signing_key\n result << \" s.signing_key = #{signing_key.dump}.freeze\"\n end\n\n if @installed_by_version\n result << nil\n result << \" s.installed_by_version = \\\"#{Gem::VERSION}\\\" if s.respond_to? :installed_by_version\"\n end\n\n unless dependencies.empty?\n result << nil\n result << \" if s.respond_to? :specification_version then\"\n result << \" s.specification_version = #{specification_version}\"\n result << \" end\"\n result << nil\n\n result << \" if s.respond_to? :add_runtime_dependency then\"\n\n dependencies.each do |dep|\n req = dep.requirements_list.inspect\n dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK\n result << \" s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})\"\n end\n\n result << \" else\"\n dependencies.each do |dep|\n version_reqs_param = dep.requirements_list.inspect\n result << \" s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})\"\n end\n result << \" end\"\n end\n\n result << \"end\"\n result << nil\n\n result.join \"\\n\"\n end", "def initialize chef_recipe\n super(chef_recipe.cookbook_name, chef_recipe.recipe_name, chef_recipe.run_context)\n\n # TODO: Support other distributions besides 'linux'\n node.default[\"serf\"][\"binary_url\"] = File.join node[\"serf\"][\"base_binary_url\"], \"#{node[\"serf\"][\"version\"]}\", \"serf_#{node[\"serf\"][\"version\"]}_linux_#{node[\"serf\"][\"arch\"]}.zip\"\n\n current_version = get_serf_installed_version\n if current_version\n Chef::Log.info \"Current Serf Version : [#{current_version}]\"\n end\n end", "def full_version\n return nil unless exact\n\n \"~> \".concat(version)\n end", "def version_config version, data\n end", "def version\n copy_file('VERSION', 'VERSION')\n end", "def resource_version\n version_file = ::File.join(install_dir, '.ts3-version')\n if ::File.exist?(version_file)\n result = ::File.read(version_file)\n else\n result = '0'\n end\n result\nend", "def redhat_version_string(sensu_version, platform_version, suffix_override = nil)\n bare_version = sensu_version.split('-').first\n if Gem::Version.new(bare_version) < Gem::Version.new('0.27.0')\n sensu_version\n else\n platform_major = Gem::Version.new(platform_version).segments.first\n suffix = suffix_override || \".el#{platform_major}\"\n [sensu_version, suffix].join\n end\n end", "def version_file\n \"lib/#{repo_name}/common/version.rb\"\nend", "def update_necessary?\n load_mixlib_versioning\n cur_version = Mixlib::Versioning.parse(current_version)\n # we have to \"resolve\" partial versions like \"12\" through mixlib-install before comparing them here\n des_version =\n if new_resource.download_url_override\n # probably in an air-gapped environment.\n Mixlib::Versioning.parse(desired_version)\n else\n Mixlib::Versioning.parse(Array(mixlib_install.artifact_info).first.version)\n end\n Chef::Log.debug(\"The current chef-client version is #{cur_version} and the desired version is #{desired_version}\")\n new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version)\nend", "def merchanthash\n if version.to_i == 1 \n return HashGenerator::generate(merchant_hash_key, merchant_id, order_id);\n else\n return Digest::SHA512.hexdigest(\"#{merchant_hash_key},#{merchant_id},01,#{order_id},#{gross_amount}\")\n end\n end", "def sha256; end", "def computed_sha(string)\n provider.computed_sha(string)\n end", "def validate_chef_version!\n unless gem_dep_matches?(\"chef\", Gem::Version.new(Chef::VERSION), *chef_versions)\n raise Exceptions::CookbookChefVersionMismatch.new(Chef::VERSION, name, version, *chef_versions)\n end\n end", "def gem_version; end", "def gem_version; end", "def gem_version; end", "def gem_version; end", "def gem_version; end", "def gem_version; end", "def v string\n Gem::Version.create string\n end", "def v string\n Gem::Version.create string\n end", "def rubocop_version; end", "def version_number\n self.name =~ /RHEL-([0-9]+)/\n return $1.to_i\n end", "def required_ruby_version\n spec.required_ruby_version\n end", "def version_for_cache\n \"download_url:#{source[:url]}|#{digest_type}:#{checksum}\"\n end", "def version\n '1.5.1.2' # Version number <major>.<minor>.<patch>.<monthly commit>\n end", "def version\n @version_helper.to_s\n end", "def version\n @version_helper.to_s\n end", "def rubocop_checksum; end", "def versionString()\n\t\t\t\treturn \"#{major}.#{minor}.#{build}\"\n\t\t\tend", "def package_version\n @semver.to_s '%M.%m.%p%s'\n end", "def version\n '2.0.7.7' # Version number <major-update>.<minor-update>.<patch-update>.<commit-count>\n end", "def get_cookbook_chef_versions ()\n cookbooks = rest.get_rest(\"/cookbooks/#{@cookbook_name}?num_version=all\")\n cookbooks[@cookbook_name]['versions'].each do |v|\n @versions.push v['version']\n end\n end", "def version\n @spec.version\n end", "def semver_version\n if Build::Check.on_tag?\n # timestamp is disabled in omnibus configuration\n Omnibus.load_configuration('omnibus.rb')\n Omnibus::BuildVersion.semver\n else\n latest_git_tag = Info.latest_tag.strip\n latest_version = latest_git_tag && !latest_git_tag.empty? ? latest_git_tag[0, latest_git_tag.match(\"[+]\").begin(0)] : '0.0.1'\n commit_sha = Build::Info.commit_sha\n ver_tag = \"#{latest_version}+\" + (Build::Check.is_nightly? ? \"rnightly\" : \"rfbranch\")\n [ver_tag, Gitlab::Util.get_env('CI_PIPELINE_ID'), commit_sha].compact.join('.')\n end\n end", "def puppet_gem_version\n Gem::Version.create(puppet_version.split(' ').first.strip.gsub('-', '.'))\n end", "def get_version\n\t\tend", "def patch_version; end", "def get_version()\n\t\tend", "def default_version; end", "def version_needed_to_extract\n 0x0014\n end", "def version_needed_to_extract\n 0x0014\n end", "def content_version(image_sourcefiles)\n \"content-#{sha256(image_sourcefiles)}\"\n end", "def latest_version\n quietly {\n uri = rest.get_rest(name)['latest_version']\n\n [ version_from_uri(uri), uri ]\n }\n rescue Net::HTTPServerException => e\n if e.response.code == \"404\"\n raise CookbookNotFound, \"Cookbook '#{name}' not found at site: '#{api_uri}'\"\n else\n raise\n end\n end", "def version\n @version ||= create_version\n end", "def module_version\n return '0.0.1' unless modulefile?\n\n metadata = ::Puppet::ModuleTool::Metadata.new\n ::Puppet::ModuleTool::ModulefileReader.evaluate(metadata, modulefile)\n\n metadata.version\n end", "def concierge_version\n context[:version]\n end", "def installed_version\n sh = shell_out('pkgutil --pkg-info com.getchef.pkg.chefdk')\n return false if sh.exitstatus.nonzero?\n ver = sh.stdout.match(/^version:\\W+([0-9]+\\.[0-9]+\\.[0-9]+)$/)[1]\n ver == package_metadata[:version] ? 'latest' : ver\n end", "def hash\n str = [major, minor, patch].map do |str|\n str ? str : \"0\"\n end.join(\".\")\n\n if pre\n str = \"#{str}.#{pre}\"\n end\n\n str.hash\n end", "def pkg_version(item)\n # refactoring! :revision points to same revision as item!\n v = revision.checkout.extract_version\n return \"#{v}pre.#{item.version}.#{item.id}\"\n end", "def test_calc_hash\n chain = \"SYSTEM>Kurt(50)\"\n block = Blockchain.new(\"5\", \"5\", chain, \"1518892051.812065000\", \"ch78\")\n hash_value = block.getHash\n calc = hash_value.strip.eql? \"ch77\"\n\n assert_equal calc, true\n end", "def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end", "def git_describe_version\n return nil unless is_git_repo and raw = run_git_describe_internal\n # reprocess that into a nice set of output data\n # The elements we select potentially change if this is an rc\n # For an rc with added commits our string will be something like '0.7.0-rc1-63-g51ccc51'\n # and our return will be [0.7.0, rc1, 63, <dirty>]\n # For a final with added commits, it will look like '0.7.0-63-g51ccc51'\n # and our return will be [0.7.0, 64, <dirty>]\n info = raw.chomp.sub(/^v/, '').split('-')\n if git_ref_type == \"tag\"\n version_string = info.compact\n elsif info[1].to_s.match('^[\\d]+')\n version_string = info.values_at(0, 1, 3).compact\n else\n version_string = info.values_at(0, 1, 2, 4).compact\n end\n version_string\n end", "def build_version(yaml_root, version)\n # yaml_dump = File.join(yaml_root, version.commit.gsub(\"/\", \"-\"))\n # return if File.exist? yaml_dump\n\n version.build\n version.clean\n #File.open(yaml_dump, \"w\") { |f| f.write(Psych.dump(version)) }\n #exit\nend", "def version_helper; end" ]
[ "0.67571723", "0.6570089", "0.6528119", "0.62239987", "0.61201304", "0.61163527", "0.6061317", "0.6061317", "0.6008768", "0.5942273", "0.5923056", "0.5911335", "0.588799", "0.5868936", "0.58665407", "0.5862085", "0.5858372", "0.5852333", "0.58497155", "0.5842781", "0.5798828", "0.57967967", "0.57716465", "0.57539934", "0.5749359", "0.5731885", "0.5694061", "0.56886953", "0.5653879", "0.5650012", "0.5647603", "0.564114", "0.5636143", "0.56084055", "0.5594273", "0.5526456", "0.55244917", "0.5500254", "0.54912966", "0.54885596", "0.5471727", "0.5462287", "0.546048", "0.546048", "0.5458498", "0.5454431", "0.54535097", "0.5451889", "0.5445896", "0.54451483", "0.54406023", "0.54345036", "0.5429059", "0.5410453", "0.54072547", "0.5405072", "0.5401591", "0.5397439", "0.53972745", "0.53884685", "0.53884685", "0.53884685", "0.53884685", "0.53884685", "0.53884685", "0.5375085", "0.5375085", "0.5364753", "0.535909", "0.5350331", "0.53502643", "0.53497285", "0.53476745", "0.53476745", "0.5344923", "0.5336026", "0.53347677", "0.5333896", "0.5330138", "0.5326114", "0.5314655", "0.5311171", "0.5309661", "0.5307659", "0.5303924", "0.5300911", "0.52940756", "0.52940756", "0.5293014", "0.5290486", "0.5286751", "0.5282937", "0.5282037", "0.5274314", "0.52736974", "0.5262303", "0.5254432", "0.525329", "0.52461386", "0.52459663", "0.52327883" ]
0.0
-1
Build the base system for generating solution
def batali_build_system system = Grimoire::System.new units = api_service.get_rest('cookbooks?num_versions=all').map do |c_name, meta| meta['versions'].map do |info| "#{c_name}/#{info['version']}" end end.flatten.map do |ckbk| Batali::Unit.new( Smash.new( :name => ckbk.split('/').first, :version => ckbk.split('/').last, :dependencies => api_service.get_rest("cookbooks/#{ckbk}").metadata.dependencies.to_a ) ) end system.add_unit(*units) system end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build()\n HP.logger.debug(\"~ Build Mode: #{build_mode}\")\n HP.logger.debug(\"~ Source Root: #{source_root}\")\n HP.logger.debug(\"~ Build Root: #{build_root}\")\n build_entries(entries())\n end", "def setup_skeleton\r\n self.destination_root = File.join(path, name)\r\n @class_name = name.classify\r\n @guid = UUIDTools::UUID.timestamp_create.to_s\r\n directory(\"base_app/\", self.destination_root)\r\n copy_file File.join(self.destination_root, \"blend_solution.sln\"), File.join(self.destination_root, \"#{@class_name}.sln\")\r\n copy_file File.join(self.destination_root, \"src\", \"ironnails_controls.csproj\"), File.join(self.destination_root, \"src\", \"#{@class_name}.Controls.csproj\")\r\n remove_file File.join(self.destination_root, \"blend_solution.sln\")\r\n remove_file File.join(self.destination_root, \"src\", \"ironnails_controls.csproj\")\r\n\r\n store_component_config('.components')\r\n end", "def build()\n \n #check dir exists, if not, make it\n if(!File.exists?(@path))\n Dir.mkdir(@path)\n end\n \n #build directory structure\n puts 'Building directory structure'\n build_skeleton(@template.directory_structure)\n \n #execute build tasks\n puts 'Running build tasks'\n execute_tasks(@template.tasks,@template.path)\n \n puts 'Skeleton built'\n \n end", "def setup_projects\n BRIX11.log(3, \"[%s] setup projects\", self)\n\n # collect all interaction types recorded for all included IDL files\n # setup their corresponding recipes for the interaction types\n interaction_types = Set.new\n # idl file for component\n @idl_files.each_value do |fidl|\n BRIX11.log(4, '[%s] %s', self, fidl)\n fidl.includes.each do |ifidl|\n # only of interest if a member of this project (and thus part of a recipe)\n if ifidl.is_member?\n BRIX11.log(4, '[%s] %s specifies %s interactions', self, ifidl, ifidl.interaction_types.to_a)\n # an empty interaction types set means non-specific port which must be SRR\n ifidl.interaction_types << :srr if ifidl.interaction_types.empty?\n\n # collect the interaction types for this include\n interaction_types.merge(ifidl.interaction_types)\n\n # setup the recipe of this IDL include for the recorded interaction types\n rcp = ifidl.recipes.first\n rcp.setup_project_interaction(ifidl, *ifidl.interaction_types.to_a)\n end\n end\n end\n\n # create the MPC projects for this recipe itself\n mpc_obj = create_comp_gen\n mpc_file.add_mpc_project(mpc_obj)\n\n unless self.combined_lib?\n if self.needs_stub?\n mpc_obj = create_stub_comp\n mpc_file.add_mpc_project(mpc_obj)\n end\n\n mpc_obj = create_lem_comp\n mpc_file.add_mpc_project(mpc_obj)\n\n mpc_obj = create_svnt_comp\n mpc_file.add_mpc_project(mpc_obj)\n end\n\n mpc_obj = create_exec_lib\n mpc_file.add_mpc_project(mpc_obj)\n\n # Until now all components have the above mentioned mpc projects\n # Maybe in the future this must move to interaction specific component handling\n\n @compdef.setup_projects if @compdef\n\n # handle interaction specific project setup for each (unique)\n # collected transaction type\n interaction_types.each do |int_type|\n handle_interaction_setup(int_type)\n end\n end", "def build; end", "def generate()\n objects = []\n\n # generate object file tasks\n files.each do |fname|\n output_file = File.join(@build_dir, File.basename(fname).ext('o'))\n objects.push output_file\n file output_file => [ fname ] do\n get_toolchain().compile( fname, output_file )\n end\n end\n\n # Link object files\n file output_file() => objects do\n get_toolchain().link( objects, output_file() )\n end\n\n # Create top level task\n desc \"Build the #{@name} application\"\n task @name => [ output_file() ]\n end", "def generate top_levels\n super\n @project_name = \"#{@outputdir.basename}.hhp\"\n generate_help_project\n end", "def build\n clean_build_directory\n copy_templates\n copy_functions\n copy_includes\n build_assets\n end", "def build_gems; end", "def initialize(params)\n\t\tsuper\n\t\tbasename = requireParam(params, :name)\n\t\tmodpaths = requireParam(params, :modules)\n\t\t\n\t\tmodpaths.each {|path| addPrereq BuildEnv::src2build(System::mod2obj(path))}\n\t\taddTarget BuildEnv::src2build(System::mod2slib(basename))\n\t\t\t\n\t\t#symlink from the src tree to the build tree (even if our target is up-to-date, in case the symlink currently points to a file built with \n\t\t# different options, ie elsewhere in the build tree)\n\t\tSymlinkBuilder.new(:target => target(), :name => BuildEnv::build2src(target()))\n\t\t\n\t\t#flags for tasks that edit their own prereq lists before reinvoking themselves\n\t\t@cleanallRecurse = true #true before cleanall() is called from outside; false when it's called by itself\n\tend", "def build \n configure_directories\n \n @spec['collision'] = 'destroy'\n \n \n jobs = []\n \n # Recon\n recon_options = {'rawdir' => @rawdir, 'epi_pattern' => /(Rest|Task)/i, }\n config_step_method(recon_options, 'recon') if @config['custom_methods']\n jobs << ReconJobGenerator.new(recon_options).build\n \n # Preproc\n preproc_options = {'scans' => jobs.first['scans']}\n config_step_method(preproc_options, 'preproc') if @config['custom_methods']\n jobs << PreprocJobGenerator.new(preproc_options).build\n \n # Stats\n stats_options = {\n 'scans' => jobs.first['scans'],\n 'conditions' => @config['conditions'],\n 'responses_dir' => @config['responses_dir'],\n 'subid' => @spec['subid']\n }\n config_step_method(stats_options, 'stats') if @config['custom_methods']\n jobs << StatsJobGenerator.new(stats_options).build\n \n @spec['jobs'] = jobs\n \n return @spec\n end", "def generator\n printf(\"%-10s %s\\n\",\"generator:\", \"generating.. (*hdls, *bmm, *scr, *prj)\")\n exitcode = 1\n FileUtils.rm_r Dir.glob(\"#{TMPDIR}/hdl/*.vhd\")\n FileUtils.rm_r Dir.glob(\"#{TMPDIR}/synthesis/*.vhd\")\n File.symlink(\"../pcores\", \"#{TMPDIR}/pcores\") unless File.symlink?(\"#{TMPDIR}/pcores\")\n pipe = IO.popen(\"platgen -od #{TMPDIR}/ -p xc4vfx100ff1152-10 -lang vhdl ../system.mhs\", \"r+\")\n # pipe = IO.popen(\"platgen -p xc4vfx12ff668-10 system.mhs\", \"r+\")\n pipe.each do |line|\n # puts line\n # do not synthesize\n if line =~ /Running XST synthesis/\n exitcode = 0\n Process.kill 'TERM', pipe.pid\n break\n end\n end\n unless exitcode == 0\n p \"# Error with platgen - check platgen.log\"\n exit\n end\n\n # he generated files under $PROJECT/TMPDIR/{hdl,synthesis}\n # copy them to $PROJECT/hdl/ under certain conditions (size differs & or abstence)\n FileUtils.mkdir('hdl') unless File.directory? 'hdl'\n FileUtils.mkdir('synthesis') unless File.directory? 'synthesis'\n FileUtils.mkdir_p(BMM_RESULTSDIR) unless File.directory? BMM_RESULTSDIR # output directory\n\n # move_files_if(\"#{TMPDIR}/hdl/*.vhd\")\n move_files_if(\"#{TMPDIR}/implementation/#{TOPLEVEL}.bmm\", BMM_RESULTSDIR)\n move_files_if(\"#{TMPDIR}/synthesis/*.scr\" )\n move_files_if(\"#{TMPDIR}/synthesis/*.prj\")\n Find.find(\"#{TMPDIR}/hdl\") do |path|\n move_files_if(path) if File.file? path\n end\n\n # move logfiles to scratch\n FileUtils.mkdir_p(GEN_SCRATCHDIR) unless File.directory? GEN_SCRATCHDIR\n [\"platgen.log\", \"platgen.opt\", \"#{TMPDIR}/clock_generator*.log\"].each { |t|\n FileUtils.mv(t, \"#{GEN_SCRATCHDIR}/\") if File.file? t\n }\n\n # change timestamps\n\nend", "def build\n raise ConfigurationError.new(\"Must specify working directory\") unless @working_dir\n raise ConfigurationError.new(\"Must specify which sources to wrap\") unless @parser\n\n Logger.info \"Beginning code generation\"\n\n @builder = Builders::ExtensionNode.new(@name, @node || @parser, @modules)\n @builder.add_includes @options[:includes]\n @builder.build\n @builder.sort\n\n Logger.info \"Code generation complete\"\n end", "def generate_all\n copy_template_dir('layouts', 'layouts')\n copy_template_dir('content/bootstrap', 'content/bootstrap')\n copy_template_dir('content/content', 'content/content')\n delete_target_file('lib/default.rb')\n copy_template_dir('lib', 'lib')\n delete_target_file('Rules')\n copy_template_file('Rules', 'Rules')\n copy_template_file('.gitignore', '.gitignore')\n copy_template_file('cg_config.rb', 'cg_config.rb')\n copy_template_file('cg_config.rb_sample', 'cg_config.rb_sample')\n delete_target_file('content/stylesheet.css')\n delete_target_file('content/index.html')\n delete_target_file('layouts/default.html')\n create_empty_dir('content/images')\n end", "def builder\n\n add_breadcrumb \"SOGR Capital Project Analyzer\"\n\n # Select the asset seed that they are allowed to build\n\n @asset_seed = []\n asset_class_name = Rails.application.config.asset_base_class_name == 'TransamAsset' ? 'TransitAsset' : Rails.application.config.asset_base_class_name\n\n asset_class_name.constantize.asset_seed_class_name.constantize.active.each do |seed|\n assets = asset_class_name.constantize.where(seed.class.to_s.underscore => seed)\n if assets.where(organization: @organization_list).count > 0\n @asset_seed << {id: seed.id, name: seed.to_s, orgs: @organization_list.select{|o| assets.where(organization_id: o).count > 0}}\n else\n @asset_seed << {id: seed.id, name: seed.to_s, orgs: []}\n end\n end\n\n @fiscal_years = get_fiscal_years(Date.today)\n @range_fiscal_years = ((1..14).to_a + (3..10).to_a.map{|x| x * 5}).map{|x| [\"#{x} years\", x-1]}\n @scenarios = Scenario.where(organization: current_user.viewable_organizations)\n @builder_proxy = BuilderProxy.new\n\n @has_locked_sogr_this_fiscal_year = CapitalPlanModule.joins(:capital_plan_module_type, :capital_plan).where(capital_plan_module_types: {name: ['Unconstrained Plan', 'Constrained Plan']}, capital_plans: {organization_id: @organization_list, fy_year: current_planning_year_year}).where('capital_plan_modules.completed_at IS NOT NULL').pluck('capital_plans.organization_id')\n\n if @organization_list.count == 1\n if @has_locked_sogr_this_fiscal_year && (@has_locked_sogr_this_fiscal_year.include? @organization_list.first)\n @fiscal_years = @fiscal_years[(@fiscal_years.index{|x| x[1]==current_planning_year_year}+1)..-1]\n end\n @builder_proxy.start_fy = current_planning_year_year\n else\n @has_sogr_project_org_list = CapitalProject.joins(:organization).where(organization_id: @organization_list).sogr.group(:organization_id).count\n end\n\n @message = \"Creating SOGR capital projects. This process might take a while.\"\n\n end", "def common_build\n puts \"common_build dir=#{pwd} #{SHOES_TGT_ARCH}\"\n #mkdir_p \"#{TGT_DIR}/ruby\"\n #cp_r \"#{EXT_RUBY}/lib/ruby/#{RUBY_V}\", \"#{TGT_DIR}/ruby/lib\"\n %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir|\n FileList[rdir].each { |rlib| cp_r rlib, \"#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}\" }\n end\n %w[req/ftsearch/ext/ftsearchrt req/chipmunk/ext/chipmunk].\n #%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk].\n each { |xdir| copy_ext xdir, \"#{TGT_DIR}/lib/ruby/#{TGT_RUBY_V}/#{SHOES_TGT_ARCH}\" }\n\n gdir = \"#{TGT_DIR}/lib/ruby/gems/#{RUBY_V}\"\n {'hpricot' => 'lib', 'sqlite3' => 'lib'}.each do |gemn, xdir|\n #{'hpricot' => 'lib', 'json' => 'lib/json/ext', 'sqlite3' => 'lib'}.each do |gemn, xdir|\n spec = eval(File.read(\"req/#{gemn}/gemspec\"))\n mkdir_p \"#{gdir}/specifications\"\n mkdir_p \"#{gdir}/gems/#{spec.full_name}/lib\"\n FileList[\"req/#{gemn}/lib/*\"].each { |rlib| cp_r rlib, \"#{gdir}/gems/#{spec.full_name}/lib\" }\n mkdir_p \"#{gdir}/gems/#{spec.full_name}/#{xdir}\"\n FileList[\"req/#{gemn}/ext/*\"].each { |elib| copy_ext elib, \"#{gdir}/gems/#{spec.full_name}/#{xdir}\" }\n cp \"req/#{gemn}/gemspec\", \"#{gdir}/specifications/#{spec.full_name}.gemspec\"\n end\n end", "def generate(output_folder, types, version_name)\n generate_objects(output_folder, types, version_name)\n copy_files(output_folder) \\\n unless @config.files.nil? || @config.files.copy.nil?\n compile_examples(output_folder) unless @config.examples.nil?\n compile_changelog(output_folder) unless @config.changelog.nil?\n # Compilation has to be the last step, as some files (e.g.\n # CONTRIBUTING.md) may depend on the list of all files previously copied\n # or compiled.\n compile_files(output_folder, version_name) \\\n unless @config.files.nil? || @config.files.compile.nil?\n\n generate_datasources(output_folder, types, version_name) \\\n unless @config.datasources.nil?\n apply_file_acls(output_folder) \\\n unless @config.files.nil? || @config.files.permissions.nil?\n end", "def bake()\n\t\tdebug \"Bake Start: #{arrayString(Process.times)}\"\n\t\tif(@clean)\n\t\t\tFileUtils.rm_r Dir.glob(\"#{@buildDestination}/*\")\n\t\t\tif(@mainTargets.empty?())\n\t\t\t\t#nothing was supposed to be compiled, we'll just abort here\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\t\tdebug \"Bake Start Lex: #{arrayString(Process.times)}\"\n\t\trunLexers()\n\t\trunParsers()\n\n\t\tdebug \"Bake Start Maintargets: #{arrayString(Process.times)}\"\n\t\t#the roots of the dependency graph, the targets we were told to build\n\t\trootSet = Set.new()\n\t\t@mainTargets.each do |src| \n\t\t\t#ignore all but .ml and .mli files. \n\t\t\tif(['.ml', '.mli'].any? {|ext| File.extname(src) == ext})\n\t\t\t\trootSet << sourceToTarget(File.expand_path(src))\n\t\t\tend\n\n\t\tend\n\t\tdebug \"\\nMain Targets:\"\n\t\tdebug setString(rootSet)\n\n\t\tdebug \"Bake Start Dependencies: #{arrayString(Process.times)}\"\n\t\t#every key is a target filename, and it's value is an array of files it\n\t\t#depends on. leafSet are those targets with no dependencies\n\t\tdependencyHash, leafSet = calcDependencies(rootSet)\n\t\tdebug \"\\nDependencies:\"\n\t\tdebug setHashString(dependencyHash)\n\n\t\tdebug \"\\nLeaf Targets:\"\n\t\tdebug setString(leafSet)\n\n\t\tdebug \"Bake Start Invert Dep: #{arrayString(Process.times)}\"\n\t\t#every key is a filename, and it's value is an array of files that\n\t\t#require it to be built before it can be built\n\t\tneededByHash = invertDependencies(dependencyHash)\n\t\t#this will make traversing over the graph have more elegant end cases\n\t\trootSet.each do |t| \n\t\t\tunless (neededByHash.has_key?(t))\n\t\t\t\tneededByHash[t] = Set.new()\n\t\t\tend\n\t\tend\n\n\t\tdebug \"\\nDependents:\"\n\t\tdebug setHashString(neededByHash)\n\t\t\n\t\tdebug \"Bake Start Ordering: #{arrayString(Process.times)}\"\n\n\t\tmasterOrdering = findOrdering(neededByHash, leafSet)\n\t\tdebug \"\\nOrdering:\"\n\t\tdebug arrayString(masterOrdering)\n\n\t\t#determine the set of files that are stale, or are dependent on stale\n\t\t#files\n\t\tdebug \"Bake Start Stale: #{arrayString(Process.times)}\"\n\t\tstaleSet = findStaleTargets(neededByHash, dependencyHash, leafSet)\n\t\tputs \"\\nStale Targets:\"\n\t\tputs setString(staleSet) + \"\\n\"\n\n\t\tdebug \"Bake Start Compile: #{arrayString(Process.times)}\"\n\t\tdebug \"\\nStart Compiling\"\n\t\tcompileSources(masterOrdering, staleSet)\n\t\tdebug \"Done Compiling\"\n\t\tdebug \"buildExecutables: \\'#{@buildExecutables}\\'\"\n\t\tif(@buildExecutables) \n\t\t\tdebug \"\\nBuilding Executables\"\n\t\t\tbinSourceSet = Set.new()\n\t\t\t@mainTargets.each do |src| \n\t\t\t\t#ignore all but .ml files. \n\t\t\t\tif(File.extname(src) == \".ml\")\n\t\t\t\t\tdebug \"Queueing: #{src}\"\n\t\t\t\t\tbinSourceSet.add(File.expand_path(src))\n\t\t\t\tend\n\t\t\tend\n\t\t\tbuildExecs(binSourceSet, masterOrdering, dependencyHash, staleSet)\n\t\tend\n\t\tdebug \"Bake End: #{arrayString(Process.times)}\"\n\tend", "def build\n Bridgetown.logger.adjust_verbosity(options)\n\n unless caller_locations.find do |loc|\n loc.to_s.include?(\"bridgetown-core/commands/start.rb\")\n end\n self.class.print_startup_message\n end\n\n # @type [Bridgetown::Configuration]\n config_options = configuration_with_overrides(\n options, Bridgetown::Current.preloaded_configuration\n )\n\n config_options.run_initializers! context: :static\n\n config_options[\"serving\"] = false unless config_options[\"serving\"]\n\n if !Bridgetown.env.production? &&\n !config_options[:skip_frontend] && config_options[\"using_puma\"]\n if Bridgetown::Utils.frontend_bundler_type(config_options[:root_dir]) == :esbuild\n Bridgetown::Utils.update_esbuild_autogenerated_config config_options\n end\n require \"rake\"\n Rake.with_application do |rake|\n rake.load_rakefile\n rake[\"frontend:watcher\"].invoke(true)\n end\n end\n\n @site = Bridgetown::Site.new(config_options)\n\n if config_options.fetch(\"skip_initial_build\", false)\n Bridgetown.logger.warn \"Build Warning:\", \"Skipping the initial build. \" \\\n \"This may result in an out-of-date site.\"\n else\n build_site(config_options)\n end\n\n if config_options.fetch(\"detach\", false)\n Bridgetown.logger.info \"Auto-regeneration:\",\n \"disabled when running server detached.\"\n elsif config_options.fetch(\"watch\", false)\n watch_site(config_options)\n else\n Bridgetown.logger.info \"Auto-regeneration:\", \"disabled. Use --watch to enable.\"\n end\n end", "def generate_help_project\n # Set which files should actually be generated\n @generated_files = @files.select { |f| f.text? }\n\n debug_msg \"Generating the help project files\"\n generate_file_index\n generate_class_index\n generate_project_file\n generate_contents\n generate_chm_index\n compile_project\n end", "def generate_constructions\n # TODO? delete and re-create or check that it exists and update?\n # self.construct_assemblies.destroy_all\n # self.materials.destroy_all\n # self.fenestration_constructions.destroy_all\n # self.door_construction.destroy_all\n\n # model names\n constructions = %w(UndergroundWall UndergroundFloor InteriorWall InteriorFloor ExteriorWall ExteriorFloor Roof)\n fenestrations = %w(Window Skylight)\n doors = ['Door']\n space_ids = []\n\n # get all building -> stories -> spaces (that's what constructions are attached to)\n stories = building.building_stories\n spaces = []\n stories.each do |story|\n story.spaces.each do |space|\n spaces << space\n end\n end\n space_ids = spaces.collect(&:id)\n logger.debug(\"*****SPACES: #{space_ids.inspect} *****\")\n\n project_cas = []\n project_mats = []\n project_fens = []\n project_doors = []\n\n # to find doors, windows, skylights\n int_wall_ids = []\n ext_wall_ids = []\n roof_ids = []\n\n # assign regular constructions\n constructions.each do |con|\n con_model = con.constantize\n instances = con_model.any_in(space_id: space_ids)\n\n if con === 'InteriorWall'\n int_wall_ids = instances.collect(&:id)\n elsif con === 'ExteriorWall'\n ext_wall_ids = instances.collect(&:id)\n elsif con === 'Roof'\n roof_ids = instances.collect(&:id)\n end\n\n # puts \"#{instances.size} instances of #{con}\"\n # logger.info \"#{instances.size} instances of #{con}\"\n\n instances.each do |instance|\n # get lib record\n unless instance.construction_library_id.nil?\n lib = Construction.find(instance.construction_library_id)\n\n # TODO: check that it doesn't exist yet or skip?\n ca = construct_assemblies.find_or_create_by(name: lib.name)\n ca.compatible_surface_type = lib.compatible_surface_type\n # save other attributes here (for floors)\n ca.slab_type = lib.slab_type\n ca.slab_insulation_orientation = lib.slab_insulation_orientation\n ca.slab_insulation_thermal_resistance = lib.slab_insulation_thermal_resistance\n\n material_refs = []\n # material references\n logger.debug(\"!!!!! LAYERS: #{lib['layers']}\")\n unless lib['layers'].nil?\n lib.layers.each do |layer|\n mat = materials.find_or_create_by(name: layer['name'])\n mat.code_category = layer['code_category']\n mat.code_item = layer['code_item']\n # save framing_configuration and material (required)\n mat.framing_depth = layer['framing_depth']\n mat.framing_configuration = layer['framing_configuration']\n mat.framing_material = layer['framing_material']\n mat.framing_material = layer['framing_material']\n mat.cavity_insulation = layer['cavity_insulation_r_value']\n\n mat.save\n material_refs << mat.name\n # only save unique records to project\n match = project_mats.find { |m| m['name'] === mat.name }\n logger.info(\"MATCH: #{match}, for material #{mat.name}\")\n project_mats << mat if match.nil?\n end\n end\n\n # save material references to construction assembly\n ca.material_reference = material_refs\n ca.save\n # only save unique records to project\n match = project_cas.find { |m| m['name'] === ca.name }\n # puts \"MATCH: #{match} for ca #{ca.name}\"\n logger.info \"MATCH: #{match} for ca #{ca.name}\"\n project_cas << ca if match.nil?\n\n # save construction assembly reference on original instance (in construct_assembly_reference field, use name)\n instance.construct_assembly_reference = ca.name\n instance.save\n end\n end\n end\n\n\n logger.info \"Exterior Wall ids are #{ext_wall_ids}\"\n\n # assign doors\n door_instances = Door.or({:interior_wall_id.in => int_wall_ids}, {:exterior_wall_id.in => ext_wall_ids})\n\n logger.info(\"Door instances: #{door_instances.size}\")\n door_instances.each do |instance|\n # get lib record\n unless instance.construction_library_id.nil?\n lib = DoorLookup.find(instance.construction_library_id)\n dc = door_constructions.find_or_create_by(name: lib.name)\n # add other lib fields\n lib.attributes.each_pair do |key, value|\n unless %(created_at updated_at id _id).include? key\n dc[key] = value\n end\n end\n dc.save\n\n # only save unique records to project\n match = project_doors.find { |m| m['name'] === dc.name }\n logger.info(\"MATCH: #{match} for door construction #{dc.name}\")\n project_doors << dc if match.nil?\n\n # save construction assembly reference on original instance (in construct_assembly_reference field, use name)\n instance.door_construction_reference = dc.name\n instance.save\n end\n end\n\n # assign fenestrations\n fenestrations.each do |fen|\n fen_model = fen.constantize\n if fen === 'Window'\n instances = fen_model.any_in(exterior_wall_id: ext_wall_ids)\n else\n # skylight\n instances = fen_model.any_in(roof_id: roof_ids)\n end\n # puts \"#{instances.size} instances of #{fen}\"\n # logger.info(\"#{instances.size} instances of #{fen}\")\n\n instances.each do |instance|\n # get lib record\n unless instance.construction_library_id.nil?\n lib = Fenestration.find(instance.construction_library_id)\n # TODO: check that it doesn't exist yet or skip?\n fc = fenestration_constructions.find_or_create_by(name: lib.name)\n # save all lib attributes to construction instance\n lib.attributes.each_pair do |key, value|\n unless %(created_at updated_at id _id).include? key\n fc[key] = value\n end\n end\n fc.save\n\n # only save unique records to project\n match = project_fens.find { |m| m['name'] === fc.name }\n logger.info(\"MATCH: #{match} for fen construction #{fc.name}\")\n project_fens << fc if match.nil?\n\n # save construction assembly reference on original instance (in construct_assembly_reference field, use name)\n instance.fenestration_construction_reference = fc.name\n instance.save\n end\n end\n end\n\n # save all to project\n self.door_constructions = project_doors\n self.fenestration_constructions = project_fens\n self.construct_assemblies = project_cas\n self.materials = project_mats\n self.save!\n end", "def build\r\n end", "def build\r\n end", "def common_build\n copy_gems # in make/gems.rb\n end", "def make; end", "def build_rake_step\n @rake_task << self.global_config # Open the rake Stek and get General Configuration information\n @rake_task << (self.render self.get_config_template) # get Specific Configuration. Defined in the [tool].rb module file (erb)\n @opt_parser.check_error # stop here if errors found in the configuration\n @rake_task << self.test_validation # step is already done ? Defined in the tool_template.rb file\n @rake_task << (self.render self.tool_template) # get specific Task Code. Defined in the [tool].rb module file (erb)\n @rake_task << self.write_validation # write the check file Defined in the tool_template.rb file\n @rake_task << self.close_step # To close the rake Step Defined in the tool_template.rb file\n end", "def build\n site.process\n end", "def build!\n create_output_directory\n spec.source_directories.each { |d| simple_compile_directory(d) }\n compile_files(spec.all_javascript_paths)\n compile_files(spec.all_stylesheet_paths)\n write_manifest\n end", "def initialize_generate\n super\n add_accessors\n declare_chefignore\n declare_gitignore\n end", "def build()\n\t`rm -rf recordings/`\n\t`mkdir recordings`\n\t`rm -rf chapters/`\n\t`mkdir chapters`\n\t`rm -rf outputList.txt`\n\t`touch outputList.txt`\nend", "def process_and_build_components \n end", "def build\n [ Sox::SOX_COMMAND,\n build_options(@options),\n build_input_files,\n build_file(@output_file),\n build_effects\n ].flatten.join(' ')\n end", "def setup\n @build_dir = File.join project.dir, 'build'\n unless Dir.exists? @build_dir\n Dir.mkdir @build_dir\n end\n\n task 'default' => 'build'\n\n desc 'Build the project'\n task 'build' => project.target do\n puts \"Built #{File.basename project.target}\".green\n end\n\n self.setup_target\n self.setup_source_files\n\n if project.test_target\n self.setup_test_target\n self.setup_test_files\n end\n\n desc 'Clean up build artifacts and target'\n task 'clean' do\n sh \"rm -f #{project.target}\"\n project.sources.each do |fn|\n fn = objectsify fn\n sh \"rm -f #{fn}\"\n end\n end\n \n namespace 'test' do\n desc 'Build the test target'\n task 'build' => project.test_target do\n puts \"Built #{File.basename project.test_target}\".green\n end\n desc 'Clean test build artifacts'\n task 'clean' do\n sh \"rm -f #{project.test_target}\"\n project.test_sources.each do |fn|\n fn = objectsify fn\n sh \"rm -f #{fn}\"\n end\n end\n end\n \n end", "def build_script\n raise NotImplementedError\n end", "def construct_solution\n path = [@root]\n tabu_list = [@root]\n until @ends.include?(last = path.last)\n step = next_step last, tabu_list\n path << step\n end\n path\n end", "def build_gem; end", "def build_everything\n puts 'building posts'\n build_posts\n puts 'building tags'\n build_tags\n puts 'building index'\n build_index\n puts 'building feed'\n build_feed\n end", "def create_workflows(\n building_types,\n vintages,\n climate_zones,\n root_directory,\n epws_path,\n hash_climate_epw,\n measures_dir = nil,\n n_runs = 5,\n efficiency_level = 2\n)\n\n unless File.directory?(File.expand_path(root_directory))\n FileUtils.mkdir_p(File.expand_path(root_directory))\n end\n\n hash_eff_level = {\n 1 => 'Low',\n 2 => 'Standard',\n 3 => 'High',\n }\n out_osw_dir = File.expand_path(File.join(root_directory, \"3~OSWs\", \"efficiency_level_#{hash_eff_level[efficiency_level]}\"))\n v_osw_paths = []\n\n building_types.each do |building_type|\n climate_zones.each do |climate_zone|\n sub_epws_path = File.expand_path(File.join(epws_path, hash_climate_epw[climate_zone]))\n vintages.each do |vintage|\n ## 1. Generate and prepare OSM\n model_name = building_type + '_' + vintage + '_' + climate_zone.split('-').last.to_s\n seed_model_folder = File.join(root_directory, '1~seeds', model_name)\n new_model_folder = File.join(root_directory, '2~processed_models', \"efficiency_level_#{hash_eff_level[efficiency_level]}\", model_name)\n old_osm_path = File.expand_path(File.join(seed_model_folder, 'SR1/in.osm'))\n old_epw_path = File.expand_path(File.join(seed_model_folder, 'SR1/in.epw'))\n new_osm_path = File.expand_path(File.join(new_model_folder, \"#{model_name}.osm\"))\n new_epw_path = File.expand_path(File.join(new_model_folder, \"#{model_name}.epw\"))\n ## Create raw building model\n create_single_model(building_type, vintage, climate_zone, seed_model_folder)\n ## Process model\n process_model(old_osm_path, new_osm_path, efficiency_level)\n FileUtils.mv(old_epw_path, new_epw_path)\n ## 2. Prepare OSW\n v_epw_paths = Dir.glob(\"#{sub_epws_path}/*.epw\")\n v_osw_paths += prepare_all_osws(new_osm_path, v_epw_paths, out_osw_dir, measures_dir, n_runs)\n\n end\n end\n end\n f = File.new(File.join(root_directory, \"job_efficiency_level_#{hash_eff_level[efficiency_level]}.txt\"), \"w\")\n f.write(v_osw_paths)\n f.close\n return v_osw_paths\nend", "def generate(spec)\n setup_project(@project_name)\n add_default_files_to_definition\n `merb-gen app --force #{@project_name}`\n cd(@project_name) do\n @parser.parse(spec)\n gen_descriptions\n gen_relationships\n gen_requirements\n # gen_add_methods\n gen_router\n gen_request_specs\n \n # replace generated controllers with what we need when using restful routes\n # as defined in the app/controllers/application.rb\n hack_controllers\n\n add_files_to_project\n add_spec_to_project\n gen_app_config_file\n gen_jeweler_rake\n end\n end", "def create_base_project\n puts \"creating base project\"\n directory \"templates\", \"#{app_path}\"\n end", "def generate\n gen_app\n handle_public_index\n gen_file(\"config/routes.rb\", \"routes\")\n @app.goals.values.each_with_index { |goal, i| gen_goal(goal, i) }\n gen_misc\n self\n end", "def generate\n setup\n\n write_style_sheet\n generate_index\n generate_class_files\n generate_file_files\n generate_table_of_contents\n @json_index.generate\n @json_index.generate_gzipped\n\n copy_static\n\n rescue => e\n debug_msg \"%s: %s\\n %s\" % [\n e.class.name, e.message, e.backtrace.join(\"\\n \")\n ]\n\n raise\n end", "def initialize_generate\n super\n add_accessors\n declare_guardfile\n declare_chefignore_patterns\n end", "def common_build\n copy_gems\n end", "def common_build\n copy_gems\n end", "def create\n create_checkpoints\n create_config_base\n generate_deploy_files\n generate_hiera_template\n end", "def configure_tasks\n super\n all_object_files = []\n all_object_folders = []\n @toolchains.each do |toolchain, sources|\n toolchain.add_include_paths(@api_headers+@configuration_headers)\n object_files, object_folders = toolchain.create_compile_tasks(sources)\n all_object_files |= object_files\n all_object_folders |= object_folders\n end\n\n project_filename = @parent_project.project_name.to_s.gsub(':','-')\n library_files, library_folders = @default_toolchain.create_static_library_tasks(all_object_files, project_filename)\n dependencies = @dependencies+all_object_folders+library_folders+library_files\n\n desc \"Build library '#{@parent_project.project_name}' with configuration '#{@configuration_name}'\"\n new_task = static_library_task @configuration_name => dependencies do |t|\n @post_build.call if @post_build.respond_to? :call\n puts \"built library #{t.name}.\"\n @tests.each do |test|\n if Rake::Task.task_defined? test\n Rake::Task[test].invoke\n else\n $stderr.puts \"warning: Skipping unknown test '#{test}'\"\n end\n end\n end\n new_task.api_headers = @api_headers\n new_task.configuration_headers = @configuration_headers\n new_task.library_files = library_files\n end", "def initialize(*args, &block)\n @id = self.class.get_id\n if args.first.is_a?(String)\n base_name = args.slice!(0)\n else\n base_name = \"e.#{@id}\"\n end\n variant_keys = (Rscons.application.active_variants || []).map do |variant|\n variant[:key]\n end.compact\n @name = [base_name, *variant_keys].join(\"-\")\n options = args.first || {}\n unless Cache.instance[\"configuration_data\"][\"configured\"]\n raise \"Project must be configured before creating an Environment\"\n end\n super(options)\n # Hash of Thread object => {Command} or {Builder}.\n @threads = {}\n @registered_build_dependencies = {}\n # Set of side-effect files that have not yet been built.\n @side_effects = Set.new\n @builder_sets = []\n @build_targets = {}\n @user_deps = {}\n # Hash of builder name (String) => builder class (Class).\n @builders = {}\n @build_hooks = {pre: [], post: []}\n unless options[:exclude_builders]\n DEFAULT_BUILDERS.each do |builder_class_name|\n builder_class = Builders.const_get(builder_class_name)\n builder_class or raise \"Could not find builder class #{builder_class_name}\"\n add_builder(builder_class)\n end\n end\n @echo =\n if options[:echo]\n options[:echo]\n elsif Rscons.application.verbose\n :command\n else\n :short\n end\n @build_root = \"#{Rscons.application.build_dir}/#{@name}\"\n @n_threads = Rscons.application.n_threads\n @build_steps = 0\n self.class.register(self)\n if block\n Environment.running_environment = self\n block[self]\n Environment.running_environment = nil\n end\n end", "def initialize_generate\n super\n declare_cookbook_gems\n declare_rake_tasks\n declare_guard_sets\n end", "def initialize(params)\n\t\tsuper\n\t\tmainmod = Pathname.new(requireParam(params, :mainmod))\n\t\tbasename = Pathname.new(params[:name] || mainmod.basename())\n\t\t\n\t\tprereqFile = BuildEnv::src2build(System::mod2obj(mainmod))\n\t\taddPrereq prereqFile\n\t\taddTarget BuildEnv::src2build(basename)\n\t\t\n\t\t#symlink from the src tree to the build tree (even if our target is up-to-date, in case the symlink currently points to a file built with \n\t\t# different options, ie elsewhere in the build tree)\n\t\tSymlinkBuilder.new(:target => target(), :name => BuildEnv::build2src(target()))\n\t\t\n\t\t#flags for tasks that edit their own prereq lists before reinvoking themselves\n\t\t@cleanallRecurse = true #true before cleanall() is called from outside; false when it's called by itself\n\tend", "def generate_project\n @writer.make_project_root\n\n project_dirs = %w(docs lib spec bin)\n @writer.create_dirs(project_dirs)\n\n files = {\n :executable => \"bin/#{@project_name}\",\n :gemspec => '',\n :gitignore => '.gitignore',\n :gitattributes => '.gitattributes',\n :gemspec => \"#{@project_name}.gemspec\",\n }\n @writer.copy_templates_for(files)\n end", "def build_model()\n \n #\n # Register the grammar specifications (only). Only do this on the first call.\n \n if @specifications.empty? then\n register_specs( @grammar_spec.specifications, build_discard_list(@grammar_spec.options) ) \n integrate_transformations( @grammar_spec.transformations.transformation_sets ) if @grammar_spec.slot_filled?(\"transformations\")\n end\n \n\n #\n # Resolve group specs into Group objects.\n \n @specifications.each do |name, spec|\n next unless spec.type.name == \"group_spec\"\n @group_defs[name] = Group.new( create_name(spec.name), process_group_data(spec, [name]) )\n end\n \n \n #\n # Resolve rule specs into Rules. \n\n @specifications.each do |name, spec|\n next unless spec.type.name == \"rule_spec\"\n \n #\n # Create the rule.\n \n if string_pattern?(spec) then\n register( Pattern.new(name_pattern(name), process_string_pattern(spec.expression.string_pattern, name)) ) unless @pattern_defs.member?(name)\n else\n transformation_set = []\n @pending_transforms = []\n @naming_contexts[name] = NamingContext.new( self )\n @rule_defs[name] = Rule.new( create_name(spec.name), process_rule_expression(spec.expression, @naming_contexts[name], transformation_set, name, spec._discard_list), spec._discard_list )\n \n #\n # Process any directives.\n \n spec.directives.each do |directive|\n case directive.type.name\n when \"associativity_directive\"\n case directive.direction.text\n when \"left\"\n @rule_defs[name].associativity = :left\n when \"right\"\n @rule_defs[name].associativity = :right\n when \"none\"\n @rule_defs[name].associativity = :none\n else\n nyi( \"unsupported associativity [#{directive.direction.text}]\", directive.direction )\n end\n else\n nyi( \"unsupported directive [#{directive.type}]\", directive )\n end\n end\n \n #\n # Commit the naming context into the Rule.\n \n @naming_contexts[name].commit( @rule_defs[name] )\n \n #\n # Process any implicit transformations. At present, this means the collection of * and + \n # terms into a list. We'll use a transformation in the form:\n # @plural_name = @tree_slot/{@_tree|@singular_name}[!pluralization_type]\n # We can use this simplified npath expression because we always construct the PluralSubrule\n # in the same way -- with one singular name mapping to one plural name, regardles of slot\n # type.\n \n @rule_defs[name].each_plural_import do |tree_slot, subrule_name, singular_name, plural_name|\n @rule_defs[name].transformations << validate_transform( name,\n Grammar.assignment_transform(\n Grammar.npath_slot_exp(plural_name),\n Grammar.npath_predicate_exp(\n Grammar.npath_path_exp( \n Grammar.npath_slot_exp(tree_slot), \n Grammar.npath_tclose_exp( Grammar.npath_branch_exp(Grammar.npath_slot_exp(\"__tree\"), Grammar.npath_slot_exp(singular_name)) )\n ),\n Grammar.npred_negation_exp( Grammar.npred_type_exp(subrule_name.name) )\n )\n )\n )\n \n @rule_defs[name].transformations << validate_transform( name,\n Grammar.unset_transform( Grammar.npath_slot_exp(tree_slot) )\n )\n end\n \n #\n # Process any explicit transformations.\n \n if spec.slot_filled?(\"transformation_specs\") then\n spec.transformation_specs.each do |transformation_spec|\n @rule_defs[name].transformations << validate_transform( name, transformation_spec )\n end\n end\n end\n end\n \n \n #\n # Apply the priority setting.\n\n if @grammar_spec.priority.direction.text == \"ascending\" then\n @pattern_defs.reverse!\n @rule_defs.reverse!\n @group_defs.reverse!\n @reorder_specs.reverse!\n @reorder_specs.each do |spec|\n spec.reorder_levels.reverse!\n end\n else\n assert( @grammar_spec.priority.direction.text == \"descending\", \"there's only two choices for this\" )\n end\n \n \n #\n # Assign rule priorities.\n \n prioritize_rules()\n\n @rule_defs.each do |name, definition|\n definition.priority = 1 if definition.is_a?(Subrule)\n end\n\n\n #\n # Display the work, if appropriate.\n\n if false then\n @rule_defs.each do |name, definition|\n definition.display( $stdout )\n $stdout.end_line\n $stdout.puts\n end\n end\n \n if false then\n @pattern_defs.each do |name, pattern|\n pattern.display( $stdout )\n $stdout.end_line\n $stdout.puts \"\"\n end\n end\n \n \n #\n # Build the Grammar Model.\n\n grammar = RCC::Model::Grammar.new( @grammar_spec.name.text )\n @pattern_defs.each {|name, definition| grammar.add_pattern(definition)}\n @rule_defs.each {|name, definition| grammar.add_rule(definition)}\n @group_defs.each {|name, definition| grammar.add_group(definition)}\n\n\n #\n # Finally, process options. We do this last for convenience.\n \n @grammar_spec.options.each do |option|\n case option.type.name\n \n when \"start_rule\"\n if @rule_defs[option.rule_name.text].is_a?(Rule) then\n grammar.start_rule_name = create_name(option.rule_name)\n else\n nyi( \"error handling for bad start_rule [#{option.rule_name.text}]\" )\n end\n \n when \"discard_switch\"\n # no op -- dealt with elsewhere\n \n warn_nyi( \"gateway expression check for corresponding discard?\" )\n warn_nyi( \"gateway expression exclusion at start AND end of rule?\" )\n \n else\n nyi( \"support for option type [#{option.type}]\", option )\n end\n end\n \n @discardable.each do |name|\n nyi( \"error handling for bad discard switch [#{name}]\" ) unless (@pattern_defs.member?(name.name) or @rule_defs.member?(name.name))\n end\n\n return grammar\n end", "def create_base_project\n raise GeneratorArgumentsError if app_path.nil?\n puts \"creating base project\"\n directory \"templates\", \"#{app_path}\"\n end", "def setup\n # Create a standard project (30 days)\n @Project1 = Project.new(Date.new(2000, 1, 1), Date.new(2000, 1, 10))\n # Create a standard calendar (30 days, 1 hour per day)\n @Calendar1 = {}\n 10.times do |iIdx|\n @Calendar1[Date.new(2000, 1, iIdx+1)] = 1\n end\n # Create standard resources\n @Resource1 = Resource.new('R1', @Calendar1)\n end", "def generate\n template_dir = File.join(File.dirname(__FILE__), \"../templates\")\n proxy_hpp = Generation.render_template template_dir, \"proxies\", \"Task.hpp\", binding\n proxy_cpp = Generation.render_template template_dir, \"proxies\", \"Task.cpp\", binding\n file_proxy_hpp = Generation.save_automatic(project.name, \"/proxies\", \"#{task.basename}.hpp\", proxy_hpp)\n file_proxy_cpp = Generation.save_automatic(project.name, \"/proxies\", \"#{task.basename}.cpp\", proxy_cpp)\n\n forward_hpp = Generation.render_template template_dir, \"proxies\", \"Forward.hpp\", binding\n file_forward_hpp = Generation.save_automatic(project.name, \"proxies\", \"#{task.basename}Forward.hpp\", forward_hpp)\n\n cmake = Generation.render_template template_dir, 'proxies', 'CMakeLists.txt', binding\n Generation.save_automatic(project.name, 'proxies', \"CMakeLists.txt\", cmake)\n \n pc = Generation.render_template template_dir, \"proxies\", \"proxies.pc\", binding\n Generation.save_automatic(project.name, \"proxies\", \"#{project.name}-proxies.pc.in\", pc)\n end", "def build_everything\n @defs.keys.each { |k| self[k] }\n end", "def build_program\n assert_ready_to_build\n\n result = build_header + build_struct_types + build_header_structs + \n build_array_command_struct_types + build_environment_struct + \n build_kernels + host_section_source\n\n # Build program entry point\n return result + Translator.read_file(file_name: \"host_section_entry_point.cpp\", replacements: {\n \"prepare_environment\" => environment_builder.build_environment_variable,\n \"host_env_var_name\" => Constants::ENV_HOST_IDENTIFIER,\n \"host_result_array\" => host_result_expression})\n end", "def build\r\n raise \"Not implemented\"\r\n end", "def setup\n build_defaults\n build_site_stub\n build_context_stub\n end", "def initialize_generate\n super\n add_accessors\n @flavor.class.do_declare_resources do\n templates_if_missing << 'metadata.rb'\n templates_if_missing << 'README.md'\n templates_if_missing << 'CHANGELOG.md'\n end\n declare_gemfile\n declare_berksfile\n declare_rakefile\n declare_chefignore_patterns\n end", "def build\n end", "def create_models(bldg_types, vintages, climate_zones, epw_files = [])\n #### Create the prototype building\n failures = []\n\n # Loop through all of the given combinations\n bldg_types.sort.each do |building_type|\n vintages.sort.each do |template|\n climate_zones.sort.each do |climate_zone|\n model_name = \"#{building_type}-#{template}-#{climate_zone}\"\n puts \"****Testing #{model_name}****\"\n\n # Create an instance of the measure\n measure = CreateDOEPrototypeBuilding.new\n\n # Create an instance of a runner\n runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)\n\n # Make an empty model\n model = OpenStudio::Model::Model.new\n\n # Set argument values\n arguments = measure.arguments(model)\n argument_map = OpenStudio::Measure::OSArgumentMap.new\n building_type_arg = arguments[0].clone\n assert(building_type_arg.setValue(building_type))\n argument_map['building_type'] = building_type_arg\n\n template_arg = arguments[1].clone\n assert(template_arg.setValue(template))\n argument_map['template'] = template_arg\n\n climate_zone_arg = arguments[2].clone\n assert(climate_zone_arg.setValue(climate_zone))\n argument_map['climate_zone'] = climate_zone_arg\n\n epw_arg = arguments[3].clone\n assert(epw_arg.setValue('Not Applicable'))\n argument_map['epw_file'] = epw_arg\n\n measure.run(model, runner, argument_map)\n result = runner.result\n show_output(result)\n if result.value.valueName != 'Success'\n failures << \"Error - #{model_name} - Model was not created successfully.\"\n end\n\n model_directory = \"#{@test_dir}/#{building_type}-#{template}-#{climate_zone}\"\n\n # Convert the model to energyplus idf\n forward_translator = OpenStudio::EnergyPlus::ForwardTranslator.new\n idf = forward_translator.translateModel(model)\n idf_path_string = \"#{model_directory}/#{model_name}.idf\"\n idf_path = OpenStudio::Path.new(idf_path_string)\n idf.save(idf_path, true)\n end\n end\n end\n\n #### Return the list of failures\n return failures\n end", "def create_mesh_cartisian_combos(optIndex) \n\n if ( optIndex == $gOptionList.count ) \n \n generated_file = gen_choice_file($gChoiceFileSet) \n \n $gGenChoiceFileList.push generated_file\n \n # Save the name of the archetype that matches this choice file for invoking \n # with substitute.h2k.\n \n # \"! Opt-Archetype\" - choice disabled because prm copies the h2k file into the run directory.\n $gArchetypeHash[generated_file] = $gChoiceFileSet[\"!Opt-Archetype\"] \n \n $gLocationHash[generated_file] = $gChoiceFileSet[\"Opt-Location\"] \n $gRulesetHash[generated_file] = $gChoiceFileSet[\"Opt-Ruleset\"] \n \n else \n \n case optIndex\n when -3 \n \n $gLocations.each do |location|\n \n $gChoiceFileSet[\"Opt-Location\"] = location \n \n create_mesh_cartisian_combos(optIndex+1) \n \n end \n \n when -2 \n \n $gArchetypes.each do |archentry|\n \n \n $Folder = $gArchetypeDir \n # Allow wildcards; expand list! \n \n $ArchetypeFiles = Dir[\"#{$Folder}/#{archentry}\"] \n \n $ArchetypeFiles.each do |h2kpath|\n \n $h2kfile = File.basename(h2kpath)\n \n $gChoiceFileSet[\"!Opt-Archetype\"] = $h2kfile \n \n create_mesh_cartisian_combos(optIndex+1) \n \n end \n \n end \n \n \n when -1 \n \n $gRulesets.each do |ruleset|\n \n $gChoiceFileSet[\"Opt-Ruleset\"] = ruleset \n \n create_mesh_cartisian_combos(optIndex+1) \n \n \n end #$gOptionList $gRulesets.each do |ruleset|\n \n \n else \n \n attribute = $gOptionList[optIndex]\n choices = $gRunUpgrades[attribute]\n \n choices.each do | choice | \n \n $gChoiceFileSet[attribute] = choice \n # Recursive call for next step in order. \n create_mesh_cartisian_combos(optIndex+1) \n end \n \n end \n \n end \n \nend", "def build_all\n create_categories\n puts \"Built categories\"\n create_contacts\n puts \"Built contacts\"\n create_locations\n puts \"Built locations\"\n create_services\n puts \"Built services\"\n create_service_types\n puts \"Built service types\"\n create_comments\n puts \"Built comments\"\n create_costs\n puts \"Built costs\"\n create_service_locations\n puts \"Built service locations\"\n create_service_contacts\n puts \"Built service locations\" \n create_users\n puts \"Built users\" \n end", "def build_me\n # Download all softwares in parallel\n download\n build\n end", "def generate(top_levels)\n @output_dir = Pathname.new(@options.op_dir).expand_path(@base_dir)\n \n @files = top_levels.sort\n @main_page = find_main_page\n @text_files = @files.select do |file|\n file != @main_page and file.text_content?\n end\n @classes = RDoc::TopLevel.all_classes_and_modules.select { |mod| mod.document_self }.sort\n @methods = @classes.map { |m| m.method_list }.flatten.sort\n\n template('index.haml', 'project_index.haml', 'index.html') do |index|\n index.vars.page_title = @options.title\n index.vars.page_type = :main\n index.vars.current_page = @main_page\n index.vars.files = @text_files\n index.vars.methods = @methods\n index.vars.classes = @classes\n end\n \n for klass in @classes\n template('class_module.haml', klass.path) do |tm|\n tm.vars.page_title = klass.full_name\n tm.vars.page_type = :class_module\n tm.vars.klass = klass\n end\n end\n \n for file in @text_files\n template('index.haml', file.path) do |file_page|\n file_page.vars.page_title = file.base_name\n file_page.vars.page_type = :file\n file_page.vars.current_page = file\n end\n end\n \n template('styles.sass', 'styles.css').write!\n end", "def generate_targets\n has_metaname = has_version?\n\n %w[clean update fetch configure export build install].each do |target|\n target_name = \"#{@name}_#{target}\".to_sym\n target_metaname = \"#{@metaname}_#{target}\".to_sym if has_metaname\n func = pkg_default_target_func(@name.to_sym, target)\n\n task = Rake::Task.define_task(target_name, &func)\n metatask = Rake::Task.define_task(target_metaname, &func) if has_metaname\n\n # Add per-task dependency\n case target\n when /install/i\n task.enhance([\"#{@name}_build\".to_sym])\n metatask.enhance([\"#{@metaname}_build\".to_sym]) if has_metaname\n when /build/i\n task.enhance([\"#{@name}_export\".to_sym])\n metatask.enhance([\"#{@metaname}_export\".to_sym]) if has_metaname\n\n # Generate package export dependencies\n @build_deps.each do |dep|\n task.enhance([\"#{dep}_export\".to_sym])\n metatask.enhance([\"#{dep}_export\".to_sym]) if has_metaname\n end\n\n # Generate package build dependencies\n @clean_deps.each do |dep|\n task.enhance([\"#{dep}_install\".to_sym])\n metatask.enhance([\"#{dep}_install\".to_sym]) if has_metaname\n end\n when /export/i\n task.enhance([\"#{@name}_configure\".to_sym])\n metatask.enhance([\"#{@metaname}_configure\".to_sym]) if has_metaname\n when /configure/i\n task.enhance([\"#{@name}_fetch\".to_sym])\n metatask.enhance([\"#{@metaname}_fetch\".to_sym]) if has_metaname\n when /clean/i\n # Generate package clean dependencies\n @clean_deps.each do |dep|\n task.enhance([\"#{dep}_clean\".to_sym])\n metatask.enhance([\"#{dep}_clean\".to_sym]) if has_metaname\n end\n end\n\n update_global_task(target, target_name)\n end\n\n # Create the default package task named after the package name\n task = Rake::Task.define_task(\"#{@name}\" => [\"#{@name}_install\".to_sym])\n metatask = Rake::Task.define_task(\"#{@metaname}\" => [\"#{@metaname}_install\".to_sym]) if has_metaname\n end", "def build(output_path = nil)\n cleanup\n iso_path = download_iso\n fetch_obs_packages\n fetch_local_packages\n build_iso(iso_path, output_path || AYTests.obs_iso_path)\n end", "def generate\n # Ensure site is a directory\n FileUtils.mkdir_p site_path\n\n # If there is more than one language, then we need to create\n # multiple files, one for each language.\n if languages.size >= 1\n\n # Enter the most dastardly loop. \n # Create a View::Document with sections only containing the \n # specified language. \n languages.map do |language|\n document_views = documents.map do |document|\n document.sections = document.sections.map do |section|\n section.examples = section.examples.select {|ex| ex.language.blank? || ex.language == language }\n section\n end\n\n Views::Document.new document\n end\n\n # Use Mustache to create the file\n page = Page.new\n page.title = title\n page.logo = File.basename logo if logo\n page.documents = document_views\n\n File.open(\"#{site_path}/#{language.underscore}.html\", \"w\") do |file|\n file.puts page.render\n end\n end\n\n # copy the default language to the index and were done!\n FileUtils.cp \"#{site_path}/#{default.underscore}.html\", \"#{site_path}/index.html\"\n\n # There are no languages specified, so we can just create one page\n # using a collection of Document::View.\n else \n document_views = documents.map do |document|\n Views::Document.new document\n end\n\n page = Page.new\n page.title = title\n page.logo = File.basename logo if logo\n page.documents = document_views\n\n File.open(\"#{site_path}/index.html\", \"w\") do |file|\n file.puts page.render\n end\n end\n\n # Copy the logo if specified\n FileUtils.cp \"#{logo}\", \"#{site_path}/#{File.basename(logo)}\" if logo\n\n # Copy all the stylesheets into the static directory and that's it!\n resources_path = File.expand_path \"../resources\", __FILE__\n\n FileUtils.cp \"#{resources_path}/style.css\", \"#{site_path}/style.css\"\n FileUtils.cp \"#{resources_path}/syntax.css\", \"#{site_path}/syntax.css\"\n end", "def build\n current = $LOADED_FEATURES.clone\n require_relative File.join(absolute_path, 'main')\n loaded = ($LOADED_FEATURES - current)\n exports = {}\n exports.merge! append_gem('gamefic')\n exports.merge! append_gem('gamefic-tty')\n loaded.each do |path|\n exports.merge! relativize(path)\n end\n files = {}\n exports.each_pair do |rel, full|\n files[rel] = Base64.encode64(Zlib::Deflate.deflate(File.read(full)))\n end\n program = program_code(files)\n FileUtils.mkdir_p File.join(absolute_path, 'builds', 'ruby')\n File.write(File.join(absolute_path, 'builds', 'ruby', \"#{File.basename(absolute_path)}.rb\"), program)\n end", "def pre_build\n puts \"pre_build dir=#{`pwd`}\"\n rbvt = RUBY_V\n rbvm = RUBY_V[/^\\d+\\.\\d+/]\n # remove leftovers from previous rake.\n rm_rf \"#{TGT_DIR}/lib\"\n rm_rf \"#{TGT_DIR}/etc\"\n rm_rf \"#{TGT_DIR}/share\"\n rm_rf \"#{TGT_DIR}/conf.d\"\n mkdir_p \"#{TGT_DIR}/lib\"\n cp_r \"#{EXT_RUBY}/lib/ruby\", \"#{TGT_DIR}/lib\"\n # copy include files\n mkdir_p \"#{TGT_DIR}/lib/ruby/include/ruby-#{rbvt}\"\n cp_r \"#{EXT_RUBY}/include/ruby-#{rbvt}/\", \"#{TGT_DIR}/lib/ruby/include\"\n SOLOCS.each_value do |path|\n cp \"#{path}\", \"#{TGT_DIR}\"\n end\n # do some windows things\n mkdir_p \"#{TGT_DIR}/share/glib-2.0/schemas\"\n if APP['GTK'] == \"gtk+-2.0\" \n cp_r\"#{TGT_SYS_DIR}/share/glib-2.0/schemas/gschema.dtd\",\n \"#{TGT_DIR}/share/glib-2.0/schemas\"\n cp_r \"#{ShoesDeps}/share/fontconfig\", \"#{TGT_DIR}/share\"\n cp_r \"#{ShoesDeps}/share/themes\", \"#{TGT_DIR}/share\"\n cp_r \"#{ShoesDeps}/share/xml\", \"#{TGT_DIR}/share\"\n cp_r \"#{ShoesDeps}/share/icons\", \"#{TGT_DIR}/share\"\n elsif APP['GTK'] == \"gtk+-3.0\"\n cp \"#{TGT_SYS_DIR}share/glib-2.0/schemas/gschemas.compiled\" ,\n \"#{TGT_DIR}/share/glib-2.0/schemas\"\n cp_r \"#{ShoesDeps}/share/fontconfig\", \"#{TGT_DIR}/share\"\n cp_r \"#{ShoesDeps}/share/themes\", \"#{TGT_DIR}/share\"\n cp_r \"#{ShoesDeps}/share/xml\", \"#{TGT_DIR}/share\"\n cp_r \"#{ShoesDeps}/share/icons\", \"#{TGT_DIR}/share\"\n else\n cp \"#{TGT_SYS_DIR}share/glib-2.0/schemas/gschemas.compiled\" ,\n \"#{TGT_DIR}/share/glib-2.0/schemas\"\n end\n sh \"#{WINDRES} -I. shoes/appwin32.rc shoes/appwin32.o\"\n cp_r \"#{ShoesDeps}/etc\", TGT_DIR\n mkdir_p \"#{ShoesDeps}/lib\"\n if APP['GTK'] == \"gtk+-3.0\"\n cp_r \"#{ShoesDeps}/lib/gtk-3.0\", \"#{TGT_DIR}/lib\" # shoes, exerb, ruby here\n else\n cp_r \"#{ShoesDeps}/lib/gtk-2.0\", \"#{TGT_DIR}/lib\" # shoes, exerb, ruby here\n end\n bindir = \"#{ShoesDeps}/bin\"\n #cp_r \"#{bindir}/fc-cache.exe\", TGT_DIR\n cp_r \"#{bindir}/gtk-update-icon-cache.exe\", TGT_DIR\n # below for debugging purposes\n if ENV['GDB'] \n cp \"#{bindir}/fc-cat.exe\", TGT_DIR\n cp \"#{bindir}/fc-list.exe\", TGT_DIR\n cp \"#{bindir}/fc-match.exe\", TGT_DIR\n cp \"#{bindir}/fc-pattern.exe\", TGT_DIR\n cp \"#{bindir}/fc-query.exe\", TGT_DIR\n cp \"#{bindir}/fc-scan.exe\", TGT_DIR\n cp \"#{bindir}/fc-validate.exe\", TGT_DIR\n end\n # disable MS Theme\n if !ENABLE_MS_THEME \n Dir.chdir(\"#{TGT_DIR}/share/themes/MS-Windows/gtk-2.0/\") do\n mv 'gtkrc', 'disabled-gtkrc'\n end\n else\n # add our overrides to the MS-Windows theme\n cp \"platform/msw/gtkrc\", \"#{TGT_DIR}/etc/gtk-2.0/\"\n end\n end", "def initialize(params)\n\t\tsuper\n\t\t@input = requireParam(params, :input)\n\t\t@mocpath = params[:mocpath]\n\t\tinEntityType, inModuleName = BuildEnv::entityTypeSafe(@input)\n\t\tif params[:output]\n\t\t\toutputName = canonicalizeFilepath(Pathname.new(params[:output]), BuildEnv::src2build(Pathname.pwd()))\n\t\telsif inEntityType == :h\n\t\t\toutputName = QtMocBuilder::mod2moc(inModuleName)\n\t\telse\n\t\t\traise \"Name of file to feed to moc must end in header extension: #{@input}\"\n\t\tend\n\t\t@output = canonicalizeFilepath(Pathname.new(outputName), Pathname.pwd())\n\t\t\n\t\taddPrereq @input\n\t\taddTarget @output\n\t\tBuildEnv::addGeneratedFile(@output)\n\t\traker = BuildEnv::raker(dir())\n\t\traker.associate(@input => [@output])\n\t\toutModuleName = BuildEnv::entityType(@output)[1]\n\t\toutModuleName = BuildEnv::src2build(canonicalizeFilepath(outModuleName, Pathname.pwd()))\n\t\tCXXObjBuilder.new(:name => outModuleName, :src => @output)\n\tend", "def build\n puts \"---> erase_old_files\" if verbose\n erase_old_files\n puts \"---> load_source\" if verbose\n load_source\n puts \"---> compose\" if verbose\n compose\n puts \"---> save_lilypond_file\" if verbose\n save_lilypond_file\n\n # Production du PDF ou du PNG\n res = case output_format\n when :pdf, nil\n puts \"---> output_as_pdf\" if verbose\n output_as_pdf\n when :png\n puts \"---> output_as_png\" if verbose\n output_as_png\n else\n puts \"Format de sortie inconnu (#{output_format}). Je sors en pdf\" if verbose\n output_as_pdf\n end\n\n if res === false || verbose\n App::show_debug\n end\n end", "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n \n # Use the built-in error checking\n if not runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n # Hard-code the building vintage\n building_vintage = 'NECB 2011'\n building_type = 'NECB'\n climate_zone = 'NECB'\n #building_vintage = '90.1-2013' \n\n # Turn debugging output on/off\n @debug = false \n \n # Open a channel to log info/warning/error messages\n @msg_log = OpenStudio::StringStreamLogSink.new\n if @debug\n @msg_log.setLogLevel(OpenStudio::Debug)\n else\n @msg_log.setLogLevel(OpenStudio::Info)\n end\n @start_time = Time.new\n @runner = runner\n\n # Load the libraries\n resource_path = \"#{File.dirname(__FILE__)}/../../../../create_DOE_prototype_building/resources/\"\n # HVAC sizing\n require_relative \"#{resource_path}/HVACSizing.Model\"\n # Canadian HVAC library\n #require_relative \"#{resource_path}/hvac\"\n # Weather data\n require_relative \"#{resource_path}/Weather.Model\"\n # HVAC standards\n require_relative \"#{resource_path}/Standards.Model\"\n # Utilities\n require_relative \"#{resource_path}/Prototype.utilities\"\n # try this\n require_relative \"#{resource_path}/Prototype.Model\"\n \n \n \n\n # Create a variable for the standard data directory\n # TODO Extend the OpenStudio::Model::Model class to store this\n # as an instance variable?\n standards_data_dir = resource_path\n \n # Load the Openstudio_Standards JSON files\n model.load_openstudio_standards_json(standards_data_dir)\n \n \n # Assign the standards to the model\n model.template = building_vintage \n \n # Make a directory to run the sizing run in\n sizing_dir = \"#{Dir.pwd}/sizing\"\n if !Dir.exists?(sizing_dir)\n Dir.mkdir(sizing_dir)\n end\n\n # Perform a sizing run\n if model.runSizingRun(\"#{sizing_dir}/SizingRun1\") == false\n log_msgs\n puts \"could not find sizing run #{sizing_dir}/SizingRun1\"\n return false\n else\n puts \"found sizing run #{sizing_dir}/SizingRun1\"\n end\n \n\n BTAP::FileIO::save_osm(model, \"#{File.dirname(__FILE__)}/before.osm\")\n \n # need to set prototype assumptions so that HRV added\n model.applyPrototypeHVACAssumptions(building_type, building_vintage, climate_zone)\n # Apply the HVAC efficiency standard\n model.applyHVACEfficiencyStandard\n #self.getCoilCoolingDXSingleSpeeds.sort.each {|obj| obj.setStandardEfficiencyAndCurves(self.template, self.standards)}\n \n BTAP::FileIO::save_osm(model, \"#{File.dirname(__FILE__)}/after.osm\")\n \n log_msgs\n return true\n\n end", "def create_base_dirs\n BASE_DIR.each do |dir|\n FileUtils.mkdir \"#{@project_name}/#{dir}\"\n $stdout.puts \"\\e[1;32m \\tcreate\\e[0m\\t#{dir}\"\n end\n FileUtils.mkdir \"#{@project_name}/app/apis/#{@project_name}\"\n $stdout.puts \"\\e[1;32m \\tcreate\\e[0m\\tapp/apis/#{@project_name}\"\n end", "def build_default_tasks\n @rake_task << self.step_template # get General Configuration information\n end", "def generate_RunScript\n file_list = Array.new\n\n\n # Get Verilog File list fro Project File\n add_opt = nil\n case @Mode\n when \"ICE\"\n printf \"@I:Open orj file .. #{@PRJ}\\n\"\n open(\"#{@PRJ}\").each do |line|\n if /^add_file\\s+-verilog\\s+\\\"(.*)\\\"/ =~ line\n file_list << $1\n end\n end\n @TopModule = \"EVA_TOP\"\n add_opt = \"--disenable_auto_reflect\"\n add_modify_inst = \"chiptop,chiptop.chip,chiptop.chip.socket,port_iobuf\"\n if @ICEVer == nil\n printf(\"@E:Not Found ICE Version\\n\")\n exit\n end\n when \"Device\"\n printf \"@I:Open orj file .. #{@Library}\\n\"\n open(\"#{@Library}\").each do |line|\n if /`include\\s+\\\"(.*)\\\"/ =~ line\n file_list << $1\n end\n end\n @ICEVer = nil\n add_modify_inst = \"socket,port*_iobuf\"\n end\n\n # make directory\n dir_name = @ProductName + \"_\" + @DevVer\n Common.make_dir(dir_name)\n dir_name = dir_name + \"/\" + @Mode\n Common.make_dir(dir_name)\n\n # Generate List File\n file = dir_name + \"/\" + @ProductName + \"_\" + @DevVer + \".list\"\n printf \"@I:generate VerilogList File .. #{file}\\n\" \n f = open(\"#{file}\",\"w\")\n file_list.each do |verilog|\n f.printf \"#{verilog}\\n\"\n end\n f.close\n\n # Genrate Startup Run-Script\n file = dir_name + \"/run_Startup.sh\"\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n \n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using #{@ProductName}\n#\n#############################################################\n\n## BASE SETTING #################\n\nFICE=/home/m0001/rl0003/product/div-micom-ice/data/proj/RL78/Common/FICE/trunk\nFMAKE=${FICE}/bin/FMake.rb\n\nRUBY=/home/product/div-micom-ice/data/proj/RL78/Common/local/ruby/bin/ruby\n\n#################################\n\nVERILOG_LIST=./#{@ProductName}_#{@DevVer}.list\nTOP_MODULE=#{@TopModule}\nPRODUCT=#{@ProductName}\nDEV_VER=#{@DevVer}\nICE_VER=#{@ICEVer}\nADD_MODIDY_INST=#{add_modify_inst}\n\n${RUBY} ${FMAKE} --startup ${VERILOG_LIST} --top_module ${TOP_MODULE} --product ${PRODUCT} --dev_ver ${DEV_VER} --ice_ver ${ICE_VER} --add_modify_inst ${ADD_MODIDY_INST} #{add_opt} --verbose\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n # Genrate Startup Run-Script\n file = dir_name + \"/run_Analyze.sh\"\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using G1C\n# - Analyze Mode\n#\n#############################################################\n\n## BASE SETTING #################\n\nFICE=/home/m0001/rl0003/product/div-micom-ice/data/proj/RL78/Common/FICE/trunk\nFMAKE=${FICE}/bin/FMake.rb\n\nRUBY=/home/product/div-micom-ice/data/proj/RL78/Common/local/ruby/bin/ruby\n\n#################################\n\nCONF=./#{@ProductName}.conf\n\n${RUBY} ${FMAKE} --analyze ${CONF} --verbose\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n\n # Genrate Run-Script\n file = dir_name + \"/run.sh\"\n @ShellFiles << [dir_name,File.basename(file)]\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using G1C\n# - Startup/Analyze Mode\n#\n#############################################################\n\n./run_Startup.sh > startup.log\n./run_Analyze.sh > analyze.log\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n\n printf \"\\nFinished Successfully\\n\"\n\n end", "def compile\n compile_libraries\n compile_ohai_plugins\n compile_compliance\n compile_attributes\n compile_lwrps\n compile_resource_definitions\n compile_recipes\n end", "def initialize(default_target, arguments)\n option_parser = OptionParser.new\n option_parser.on('--no-ivy') { @no_ivy = true }\n option_parser.on('--no-compile') { @no_compile = true }\n option_parser.on('--no-demo') { @no_demo = true }\n option_parser.on('--no-schema') { @no_schema = true }\n option_parser.on('--no-jre') { @no_jre = true }\n option_parser.on('--no-no') do \n @no_ivy = true\n @no_demo = true\n @no_schema = true\n end\n option_parser.on('--emma') do Registry[:emma] = true end\n \n @start_time = Time.now\n @basedir = FilePath.new(File.dirname(File.expand_path(__FILE__)), \"..\").canonicalize\n Registry[:basedir] = @basedir\n puts(\"Building with base directory: '#@basedir'.\")\n puts\n @default_target = default_target\n @ant = TerracottaAnt.new\n Registry[:ant] = @ant\n @platform = CrossPlatform.create_implementation(:ant => @ant)\n Registry[:platform] = @platform\n \n # The CommandLineConfigSource actually parses its arguments, and returns only the ones\n # that aren't configuration property settings (e.g., of the form 'a=b').\n arguments = option_parser.parse(arguments)\n @arguments, command_line_source = CommandLineConfigSource.from_args(arguments)\n @internal_config_source = InternalConfigSource.new\n Registry[:internal_config_source] = @internal_config_source\n @config_source = create_config_source(command_line_source, @internal_config_source)\n Registry[:config_source] = @config_source\n Registry[:command_line_config] = command_line_source\n\n @script_results = ScriptResults.new\n\n if Registry[:emma]\n Registry[:emma_home] = FilePath.new(@basedir.to_s, \"..\", \"..\", \"buildsystems\", \"emma-2.0.5312\").canonicalize.to_s\n fail(\"EMMA_HOME does not exist: #{Registry[:emma_home]}\") unless File.exists?(Registry[:emma_home])\n Registry[:emma_lib] = \"#{Registry[:emma_home]}/lib/emma.jar\"\n puts \"EMMA_HOME: #{Registry[:emma_home]}\"\n end\n\n # XXX: this is a hack to get around jruby script converting JAVA_HOME to unix path\n begin\n if `uname` =~ /CYGWIN/i\n ENV['JAVA_HOME'] = `cygpath -w #{ENV['JAVA_HOME']}`.strip\n end\n rescue\n # do nothing\n end\n\n reset\n end", "def generate\n super\n end", "def build\n dir = Dir::pwd + \"/\" + @modname\n if FileTest::directory?(dir)\n abort @options[:modulename] + \" directory already exists.\"\n end\n\n Dir::mkdir(dir)\n @pattern.manitemplates.each do |m|\n target = File.open(dir + \"/\" + m, 'a')\n File.open(@pattern.templatedir + \"/\" + m, 'r').each_line do |s|\n # Write in new parameters on appropriate lines if there are any\n if s.match(/#\\$PARAM/)\n if @options[:parameters]\n @options[:parameters].each do |p|\n temp = s.gsub(/PARAM/, p)\n temp.gsub!(/MODNAME/, @modname)\n temp.sub!(/#/, \"\")\n target.write temp\n end\n else\n ## Does not write template line if no params\n next\n end\n else\n # Otherwise just make sure the module name is correct\n target.write s.gsub(/MODNAME/, @modname)\n end\n end\n target.close\n end\n rescue Errno::EEXIST\n abort @options[:modulename] + \" directory already exists.\"\n end", "def build(params); end", "def build\n end", "def run!\n # Validate paths\n validate_paths!\n \n # Extract mockup\n copy_source_path_to_build_path!\n \n validate_stack!\n \n # Run stack\n run_stack!\n \n # Run finalizers\n run_finalizers!\n \n # Cleanup\n cleanup! if self.config[:cleanup_build]\n \n end", "def build_environment_resources(environment, system_exec)\n puts \"Building all required resources for environment '#{environment.environment_name}'\"\n\n if environment.is_drupal_environment?\n build_css_and_js_for_drupal\n environment.create_template_resources\n end\n\n copy_project_dependencies_for_awestruct_image\n build_base_docker_images(environment, system_exec)\n build_environment_docker_images(environment, system_exec)\n\nend", "def build_core\n code = ''\n\n code += File.read(RUNTIME_PATH)\n code += build_stdlib('core.rb', 'core/*.rb')\n code += \"opal.require('core');\"\n\n code\n end", "def perform\n\tcheck_if_user_gave_input\n\tcreate_folder(get_folder_name)\n\t\n\tDir.chdir(\"#{get_folder_name}\")\n\t\n\tgemfile_creation\n\tgit_init\n\tdotenv_gitignore\n\tlib\n\trspec\n\treadme\n\n\tprint 'enter the title of your main ruby file : '\n\tmain_dot_rb = STDIN.gets.chomp\n\tputs ''\n\n\tDir.chdir('lib') do\n\t\tcreate_main_dot_rb(main_dot_rb)\n\t\tcreate_template_dot_rb\n\tend\n\n\tDir.chdir('spec') do\n\t\tcreate_main_spec_dot_rb(main_dot_rb)\n\t\tcreate_template_spec_dot_rb\n\t\tsystem(\"subl #{main_dot_rb}_spec.rb\")\t\n\tend\nend", "def build_new_docs\n FileUtils.mkdir_p @temp_root\n @automations.each do |auto|\n \n debug_msg \"Working with #{auto.short_name}\"\n build = @builds_map[auto.short_name]\n versions_to_build = []\n debug_msg \" fetching available verions\"\n if build\n max_build_version = build.versions.max\n versions_to_build += auto.available_versions.select{|v| v > max_build_version}\n else\n n = (auto.respond_to? :versions_to_build) ? auto.versions_to_build : 1\n versions_to_build += auto.available_versions.sort[-n..-1]\n end\n \n if versions_to_build.size > 0\n debug_msg \" versions to build: #{versions_to_build.join(', ')}\"\n else\n debug_msg \" nothing to build\"\n end\n versions_to_build.each do |version|\n build_version auto, version\n end\n \n debug_msg \"\"\n end\n \n clean_up\n end", "def initialize(params)\n\t\tsuper\n\t\tinputs = ensureArray(requireParam(params, :inputs))\n\t\t@cmd = requireParam(params, :cmd)\n\t\toutputs = ensureArray(requireParam(params, :output)).map {|filepath| if filepath.relative? then canonicalizeFilepath(filepath, Dir.pwd()) else filepath end}\n\t\t\n\t\tinputs.each {|filepath| addPrereq filepath}\n\t\toutputs.each {|filepath| addTarget filepath; BuildEnv::setEntityBuilt filepath}\n\t\toutputs.each {|filepath| BuildEnv::addGeneratedFile filepath}\n\tend", "def setup_skeleton\n self.destination_root = File.join(path, name)\n @class_name = name.classify\n directory(\"base_app/\", self.destination_root)\n store_component_config('.components')\n end", "def build_vars\n\n end", "def build_output(**config)\n raise NotImplementedError\n end", "def execute\n #require 'erb'\n\n root = Dir.pwd\n\n #has_profile = POM::Profile.find(root)\n has_profile = Dir.glob('profile{,.yml,.yaml,.rb}', File::FNM_CASEFOLD).first\n\n if has_profile and not $FORCE #if POM::Profile.find(root) and not $FORCE\n $stderr << \"PROFILE already exists. Use --force option to allow overwrite.\\n\"\n exit -1\n end\n\n require_rubygems\n\n require 'readme'\n require 'gemdo/gemspec'\n\n #prime = { \n # 'name' => File.basename(root),\n # 'version' => '0.0.0',\n # 'requires' => [],\n # 'summary' => \"FIX brief one line description here\",\n # 'contact' => \"FIX name <email> or uri\",\n # 'authors' => \"FIX names of authors here\",\n # 'repository' => \"FIX master public repo uri\"\n #}\n\n #current = Dir.glob('**/*', File::FNM_DOTMATCH)\n\n #if !File.exist?('.ruby')\n # File.open('.ruby', 'w'){|f| f << `ruby -v`}\n #end\n\n #has_package = Gemdo::Rubyspec.find(root)\n\n #if has_profile && !$FORCE\n # $stderr.puts \"Looks like your project is already built on a gemdo.\"\n # $stderr.puts \"To re-create the metadata files use the --force option.\"\n # return\n #end\n\n #name = File.basename(root)\n\n project = POM::Project.new(root)\n\n #name = project.name || File.basename(root)\n# profile = project.profile\n\n #if !has_package\n # #metadata.new_project\n # metadata.name = File.basename(root)\n # metadata.version = '0.0.0'\n # metadata.codename = 'FIXME A version codename is optional'\n #end\n\n# profile.summary = \"FIXME brief one line description here\"\n# profile.contact = \"FIXME name <#{ENV['EMAIL']}>\"\n# profile.authors << \"FIXME list of author's names here\"\n# profile.homepage = \"FIXME: http://your_website.org\"\n #profile.resources.repository = \"FIXME: master public repo uri\"\n\n if resources.empty?\n resources << Dir.glob('*.gemspec').first\n resources << Dir.glob('README{,.*}').first\n end\n\n resources.compact!\n\n resources.each do |file|\n case file\n when /\\.gemspec$/\n text = File.read(file)\n gemspec = /^---/.match(text) ? YAML.load(text) : Gem::Specification.load(file)\n project.import_gemspec(gemspec)\n when /^README/i\n readme = Readme.load(file)\n project.import_readme(readme)\n else\n text = File.read(file)\n obj = /^---/.match(text) ? YAML.load(text) : text\n case obj\n when ::Gem::Specification\n project.import_gemspec(obj)\n when String\n project.import_readme(obj)\n #when Hash\n #metadata.mesh(obj)\n else\n puts \"Cannot convert #{file} (skipped)\"\n end\n end\n end\n\n #project.root = root\n\n # load any meta entries that may already exist\n #project.reload unless options[:replace]\n\n #profile_file = profile.file ? profile.file : File.join(root,'PROFILE')\n\n #if $TRIAL\n #else\n # #if $FORCE or !(has_package or has_profile)\n # metadata.backup!\n # metadata.save! #(package_file)\n # #end\n #end\n\n text = project.profile.render\n \n if $TRIAL\n puts text\n else\n File.open('Profile', 'w'){ |f| f << text }\n\n puts \"'Profile' has been created or updated. Please review\"\n puts \"this file carefully and edit as needed.\\n\"\n end\n\n\n #diff = Dir.glob('**/*', File::FNM_DOTMATCH) - current\n #diff = diff.select{ |f| File.file?(f) }\n\n #if diff.empty?\n # puts \"Nothing has been done.\"\n #else\n # diff.each do |f|\n # puts \" #{f}\"\n # end\n #end\n end", "def gen_sub_directories\n\t\t@outputdir.mkpath\n\tend", "def gen_sub_directories\n\t\t@outputdir.mkpath\n\tend", "def build!\n end", "def globalSetup()\n # Build\n run(\"cd '#{Embedding::CODE_PATH}' && make clean && make\")\nend", "def generate\n verify_path\n \n self.layouts.each {|layout| layout.write_file}\n self.pages.each {|page| page.write_file}\n \n Webby.site.content_dir = self.content_dir\n Webby.site.layout_dir = self.layout_dir\n Webby.site.template_dir = self.template_dir\n Webby.site.output_dir = self.output_dir\n \n Merb.logger.debug \"content_dir: #{Webby.site.content_dir}\"\n Merb.logger.debug \"layout_dir: #{Webby.site.layout_dir}\"\n Merb.logger.debug \"template_dir: #{Webby.site.template_dir}\"\n Merb.logger.debug \"output_dir: #{Webby.site.output_dir}\"\n \n # Use directory => '.' option to generate the site in output_dir\n Webby.site.page_defaults = {'layout' => self.default_layout.relative_path,\n 'directory' => '.',\n 'collision' => :force}\n \n Merb.logger.debug \"page_defaults: #{Webby.site.page_defaults}\" \n # returns nil if success \n # Webby::Builder.run\n Webby::Builder.run :rebuild => true\n end", "def run_all\n \n projects.each do |project|\n project.targets.each do |target|\n config = target.config('Debug')\n UI.info((\"*\" * 80))\n UI.info \"Building #{project.name} - #{target.name} - #{config.name}\"\n UI.info((\"*\" * 80))\n config.builder.build\n end\n end\n \n end", "def configure_tasks\n super\n all_sources = []\n @toolchains.each do |toolchain, sources|\n all_sources |= sources\n toolchain.output_folder = @output_folder\n toolchain.project_folder = @project_folder\n toolchain.output_decorator = \"-#{@configuration_name}\"\n CompiledConfiguration.add_framework_dependencies_to_toolchain(toolchain, @dependencies)\n end\n # Give the default toolchain an opportunity to scan all source files for\n # any special needs. For example, a toolchain might look for .cpp files\n # to determine that it should link a project with the \"g++\" vs \"gcc\".\n @default_toolchain.scan_sources(all_sources)\n end", "def project_analysis(base_dir)\n @current_base_dir = base_dir\n\n puts \"Je traite #{base_dir}\"\n Dir.chdir(base_dir) do\n initialize_project\n preclean_project\n before_files = stats_before_compil\n compilation\n stats_after_compil(before_files)\n correction\n finalize_project\n end\n\n @current_base_dir = nil\n end" ]
[ "0.6551143", "0.6481094", "0.6448664", "0.64158076", "0.6411115", "0.6241133", "0.6204607", "0.619607", "0.616401", "0.6142587", "0.6133116", "0.6115252", "0.60413915", "0.6032264", "0.6022114", "0.599538", "0.59832394", "0.59813315", "0.59603006", "0.5945617", "0.59408545", "0.5927637", "0.5927637", "0.591651", "0.5894271", "0.58906025", "0.58874744", "0.58788824", "0.58765906", "0.5876145", "0.58327633", "0.58236015", "0.58148324", "0.5811008", "0.5793977", "0.5769269", "0.5765545", "0.5764979", "0.5759748", "0.5749025", "0.57279", "0.5722816", "0.57212484", "0.5703554", "0.5703554", "0.56986433", "0.56948036", "0.5693772", "0.56927764", "0.568542", "0.56851876", "0.5680645", "0.56764567", "0.5672688", "0.5670692", "0.56630445", "0.5662288", "0.56439996", "0.56299675", "0.5623723", "0.5610132", "0.5608648", "0.5607684", "0.5602963", "0.5600047", "0.55937576", "0.55706376", "0.55551875", "0.5553583", "0.55450696", "0.55447614", "0.5542169", "0.5540836", "0.5540107", "0.55399054", "0.5536039", "0.5534085", "0.5515541", "0.5514575", "0.55138254", "0.55125254", "0.5512253", "0.5511466", "0.551066", "0.5507566", "0.5493822", "0.5491181", "0.5479799", "0.5479072", "0.54785585", "0.5476559", "0.5468718", "0.5465451", "0.5458565", "0.5458565", "0.54556465", "0.5453003", "0.5445214", "0.5436356", "0.5423834", "0.54188806" ]
0.0
-1
Build score keeper if it is enabled via settings
def batali_build_score_keeper if(batali_least_impact?) Chef::Log.warn "Batali 'least impact resolution' is currently enabled!" if(node[:batali] && node[:batali][:last_resolution]) Batali::ScoreKeeper.new( :manifest => Batali::Manifest.new( :cookbooks => node[:batali][:last_resolution].map{ |c_name, c_version| Batali::Unit.new( :name => c_name, :version => c_version ) } ) ) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build_score_tree\n tree_nodes = []\n root_node = nil\n\n @nodes.each do |n|\n if n['key'] == 1\n root_node = build_node_from_model(n)\n root_node['parent_id'] = 0\n else\n tree_nodes.push(build_node_from_model(n))\n end\n end\n\n node_list = { 1 => root_node }\n tree_nodes.each do |n|\n node_list[n['id']] = n\n node_list[n['parent_id']]['children'].push(node_list[n['id']])\n end\n root_node\n end", "def initialize\n\t\t@scores = {\n\t\t\ttime: nil,\n\t\t\tpoints: 0,\n\t\t\tkills: 0\n\t\t}\n\t\t@start_time = nil\n\t\t@font = RESOURCES[:fonts][:score]\n\t\t@text_padding = SETTINGS.score :text_padding\n\t\t@colors = SETTINGS.score :colors\n\t\t@z_indexes = SETTINGS.score :z_indexes\n\t\t@background_size = SETTINGS.score :background_size\n\tend", "def set_gtm_score(opts)\n opts = check_params(opts,[:scores])\n super(opts)\n end", "def build_score(sub, mark, parent_subject_id = nil)\n subject_comp = sub_components.find_by(:type => sub.class.name, :obj_id => sub.id, :parent_subject_id => parent_subject_id)\n return unless subject_comp\n score = new_score(sub,mark,subject_comp)\n if sub.class.name == 'Subject'\n add_to_score_hash(sub, score.score.to_f)\n unless sub.exclude_for_final_score\n @total_score += score.score.to_f if sub.batch_subject_group_id.present? ? (sub.batch_subject_group.calculate_final ? false : true ) : true\n @total_max += score.max_score.to_f if (score.score.present? or score.is_absent) and (sub.batch_subject_group_id.present? ? (sub.batch_subject_group.calculate_final ? false : true ) : true)\n end\n elsif sub.class.name == 'BatchSubjectGroup' and sub.calculate_final\n @total_score += score.score.to_f \n @total_max += score.max_score.to_f if (score.score.present? or score.is_absent)\n end\n @scores.push score\n end", "def score!\n \"#{self.class}Scorer\".constantize.new(self).score_all!\n end", "def build_settings(mode=:debug)\n ret = {}\n deps = mode == :debug ? sorted_deps : sorted_runtime_deps\n deps.each { |dep| merge_build_settings(ret, dep, mode) }\n merge_build_settings ret, self, mode, false\n ret\n end", "def tag_best_score\n if self.user_id == nil\n self.update!({ :best_level_user_score => true })\n else\n l_u = LevelUserLink.where(:user_id => self.user_id, :level_id => self.level_id)\n .where('pushes < :p or (pushes = :p and moves < :m) or (pushes = :p and moves = :m and created_at > :c)',\n :p => self.pushes, :m => self.moves, :c => self.created_at)\n if l_u.empty?\n LevelUserLink.where('id != ?', self.id).where(:user_id => self.user_id, :level_id => self.level_id).each do |score|\n score.update!({ :best_level_user_score => false })\n end\n self.update!({ :best_level_user_score => true })\n else\n self.update!({ :best_level_user_score => false })\n end\n end\n end", "def default_level?\n experience_points_threshold == 0\n end", "def cheat_on\n if @score >= 100 and @cheat == false\n @cheat = true\n @score -= 100\n end\n end", "def pbTrainerLevelIs?(level)\r\n return ($PokemonGlobal.trainerLevel==level)\r\nend", "def gen_score\n ## Calculate the score here!\n\n total_score = victories + coins/3 + blues + yellows + purples + leaders + blacks\n ## Greens\n greens = [tablets, compasses, gears]\n total_score += (greens.min*7) + greens[0]**2 + greens[1]**2 + greens[2]**2\n self.score = total_score\n end", "def update_score()\r\n @score += GAME_PRESET[\"score_increment\"]\r\n end", "def init_scoreboard(players)\n @scoreboard = {}\n\n players.each do |player|\n @scoreboard[player.name] = 0\n end\n end", "def save_score\n if current_score > 0\n score = Score.new\n score.score = current_score\n score.category = current_category\n score.user = current_user\n\n score.save\n end\n end", "def enabled?\n $game_switches[Yuki::Sw::Pokedex]\n end", "def game_score(score)\n end", "def levelUp\n @level += 1\n # every level requires a higher score threshhold score to advance\n @threshold += level * 150\n\n # after 9 planes, stop adding planes to make it possible to have\n # somewhere to go to dodge the planes if there is not laser\n game.add_plane if level < 9\n end", "def score_redis\n case tipo.estandariza\n when 'estado'\n 1000\n when 'municipio'\n 100\n when 'anp'\n 10\n end\n end", "def enable_or_disable_scores\n if params[:scores].present?\n session[:show_scores] = ! SCORE_OFF_VALUES.include?(params[:scores])\n end\n end", "def setup\n @potential_plays = [\"rock\", \"paper\", \"scissors\"]\n @win_counter = Hash[\"P1\",0, \"P2\",0]\n end", "def scores_enabled?\n session[:show_scores] != false\n end", "def score\n [base_score] + kickers\n end", "def build_scene\n boards = TicTacToeEngine::TTT::CONFIG.boards\n scene.build do\n menu do\n label\n board_selection do\n boards.keys.each do |key|\n if boards[key][:active]\n if key == :'3x3'\n board_3x3 :id => 'board_3x3', :players => 'board_type'\n end\n if key == :'4x4'\n board_4x4 :id => 'board_4x4', :players => 'board_type'\n end\n end\n end\n end\n end\n __install \"options_scene/partial_options.rb\"\n end\n end", "def key_for(score)\n if score.nil?\n return :not_participated\n end\n\n # if you change the scoring, remember to change the 'about method' page as well.\n case score\n when 0...33\n :against\n when 33...66\n :for_and_against\n when 66..100\n :for\n end\n end", "def update\n\t\tputs self.score_status_modif\n\t\tif self.score_status_modif\n\t\t\tputs 1\n\t\t\tcase score_status\n\t\t\t\n\t\t\t#unregistered\n\t\t\twhen SCORE_STATUS[0]\n\t\t\t\tputs 2\n\t\t\t\tself.score_component=[score_admin=Sigmoid.new,\n\t\t\t\t\t score_response=Sigmoid.new,\n\t\t\t\t\t score_connected=Sigmoid.new]\n\n\t\t\t#beginner\n\t\t\twhen SCORE_STATUS[1]\n\t\t\t\tself.score_component=[]\n\n\t\t\t#casual\n\t\t\twhen SCORE_STATUS[2]\n\t\t\t\tself.score_component=[]\n\n\t\t\t#master\n\t\t\twhen SCORE_STATUS[3]\n\t\t\t\tself.score_component=[]\t\t\t\t\n\t\t\tend\n\t\t\tself.score_status_modif=false\n\t\tend\t\t\t\t\t\n\t\tcompute\n\tend", "def load_settings\n @settings ||= Course::LeaderboardSettings.new(current_course.settings(:leaderboard))\n end", "def initialize(&block)\n @on_level_up = block\n @score = 0\n @level = 0\n end", "def initialize\n @max_score = 10.0\n super\n end", "def others_reached_score(level_score)\n check_reached_score = Array.new\n Monster.where.not(id: self.monster_id).each do |monster|\n killed_monsters_each_monster = KilledMonster.where(monster_id: monster.id, user_id: self.user.id)\n score_by_monster = killed_monsters_each_monster.size\n #puts \"monster name: #{monster.name} score: #{score_by_monster}\" \n check_reached_score << (score_by_monster >= level_score.score ? true : false)\n # puts \"Pontuação : #{check_reached_score}\"\n end\n check_reached_score\n end", "def default_level?\n experience_points_threshold == DEFAULT_THRESHOLD\n end", "def update_score!\n update(score: game.rounds.count { |g| g.winner == self })\n game.update(winner: self) if score >= game.max_points\n end", "def score(depth)\n # print depth\n # If state has already been calculated as win or loss,\n # Return score\n if @score != nil\n return @score\n end\n # If @game is over, return appropriate score\n if won?\n best_score = self.class::MAX_SCORE - depth # player won\n elsif lost?\n best_score = -self.class::MAX_SCORE + depth # player lost\n elsif done?\n best_score = 0 # draw\n elsif depth > self.class::MAX_DEPTH && !force_analysis\n # If too deep, use game-specific scoring\n # Default is just to give score of 1 (slightly better than draw)\n # print \".\"\n best_score = heuristic_score\n else\n # Otherwise find and score best move for opponent\n best_score = best_move_with_score(depth + 1)[1]\n end\n # Add score to master list and return it\n if best_score == self.class::MAX_SCORE || best_score == -self.class::MAX_SCORE\n @score = best_score\n end\n # print best_score\n best_score\n end", "def package_rules\n {\n 1 => %w( p1 p2 ),\n 2 => %w( p1 p2 ),\n 3 => %w( p1 ),\n }.fetch(level)\n end", "def set_score\n if $Iterator >= 0 && $Iterator < $Length\n @questions = @subgenre.questions.all\n @question = @questions[$Iterator]\n @options = @question.options.all\n @useranswers = params[:answer_ids]\n flag = 0\n if !@useranswers\n flag = 1\n else\n for option in @options\n if @useranswers.include? (option.id).to_s && option.isanswer == 0\n flag = 1\n break\n elsif option.isanswer == 1 && !(@useranswers.include? (option.id).to_s)\n flag = 1\n break\n end\n end\n end\n if flag == 0\n @stat = Stat.find_by(subgenre_id: @subgenre.id, user_id: session['user_id'])\n x = @stat.score\n y = @question.score\n @stat.update_attributes(score: x+y)\n end\n end\n end", "def build_sampler(settings)\n if (sampler = settings.tracing.sampler)\n if settings.tracing.priority_sampling == false\n sampler\n else\n ensure_priority_sampling(sampler, settings)\n end\n elsif (rules = settings.tracing.sampling.rules)\n post_sampler = Tracing::Sampling::RuleSampler.parse(\n rules,\n settings.tracing.sampling.rate_limit,\n settings.tracing.sampling.default_rate\n )\n\n post_sampler ||= # Fallback RuleSampler in case `rules` parsing fails\n Tracing::Sampling::RuleSampler.new(\n rate_limit: settings.tracing.sampling.rate_limit,\n default_sample_rate: settings.tracing.sampling.default_rate\n )\n\n Tracing::Sampling::PrioritySampler.new(\n base_sampler: Tracing::Sampling::AllSampler.new,\n post_sampler: post_sampler\n )\n elsif settings.tracing.priority_sampling == false\n Tracing::Sampling::RuleSampler.new(\n rate_limit: settings.tracing.sampling.rate_limit,\n default_sample_rate: settings.tracing.sampling.default_rate\n )\n else\n Tracing::Sampling::PrioritySampler.new(\n base_sampler: Tracing::Sampling::AllSampler.new,\n post_sampler: Tracing::Sampling::RuleSampler.new(\n rate_limit: settings.tracing.sampling.rate_limit,\n default_sample_rate: settings.tracing.sampling.default_rate\n )\n )\n end\n end", "def optimise_for_armor_then_stat(score, stat, best_build, items)\n if best_build['score'].nil?\n best_build['score'] = 0\n end\n if best_build[stat].nil?\n best_build[stat] = 0\n end\n if best_build['armor'].nil?\n best_build['armor'] = 0\n end\n\n if score['armor'] > best_build['armor']\n best_build['armor'] = score['armor']\n best_build[stat] = score[stat]\n best_build['items'] = deep_copy(items)\n end\n\n return best_build\nend", "def get_score\n @score ||= calculate_score\n end", "def initialize( score_id )\n @score = Score.find( score_id )\n @nodes = @score.score['nodeDataArray']\n @tree = build_score_tree\n end", "def initialize_score\n\n self.score = 3\n\n end", "def create\n @suite = Suite.new(params[:suite])\n vulnerabilities = Vulnerability.find(:all, :conditions => {:published => @suite.start..@suite.end } )\n #weaknesses is a hash mapping weaknesses to the vulnerabilities they map to, ie Sequel Injection => [a, b, c...]\n weaknesses = {} \n averages = {}\n vulnerabilities.each do |vulnerability|\n if weaknesses.has_key? vulnerability.weakness.id\n weaknesses[vulnerability.weakness.id].push vulnerability\n #updated averages\n averages[vulnerability.weakness.id] += vulnerability.score\n else\n weaknesses[vulnerability.weakness.id] = [vulnerability]\n averages[vulnerability.weakness.id] = vulnerability.score\n #set initial average...\n end\n end\n averages.each { |k, v| averages[k] = v/weaknesses[k].size }\n \n #find ranks\n #in array, insert all vulnerability/count pairs, sort by pairs.\n ranks = []\n weaknesses.each do |weakness, vulnerabilities|\n count = vulnerabilities.length\n ranks.push [weakness, count]\n end\n \n ranks.sort! {|a, b| a[1] <=> b[1]}\n\n\n rank_multiplier = 10.0 / ranks.length\n \n ranks.each_with_index do |rank, index|\n weaknesses[rank[0]] = (index + 1) * rank_multiplier\n end\n \n ranks.clear\n \n weaknesses.each do |weakness, rank|\n score = rank * @suite.weight + averages[weakness] * (1.0 - @suite.weight)\n logger.info \"#{weakness}: #{averages[weakness]}, #{rank}, #{score}\";\n ranks.push [weakness, score]\n end\n \n #now sort, choose top weaknesses...\n ranks.sort! {|a,b| b[1] <=> a[1]} #sorting highest to lowest.\n ranks[0...@suite.top].each do |top_rated|\n @suite.tests.build( :weakness_id => top_rated[0] )\n end\n \n @suite.key = (0...10).map{ ('a'..'z').to_a[rand(26)] }.join\n \n respond_to do |format|\n if @suite.save\n flash[:notice] = 'Suite was successfully created.'\n format.html { redirect_to(@suite) }\n format.xml { render :xml => @suite, :status => :created, :location => @suite }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @suite.errors, :status => :unprocessable_entity }\n end\n end\n end", "def production_loaded\n if TicTacToeEngine::TTT::CONFIG.boards.active.size == 0\n puts \"***Error***: No active boards found\"\n close\n end\n @scoreboard = TicTacToeEngine::Scoreboard.new\n TicTacToeEngine::TTT.initialize_cache\n @board_selection = TicTacToeEngine::TTT::CONFIG.boards.active.first\n @player_selection = [{:id => TicTacToeEngine::TTT::CONFIG.pieces[:o], :name => TicTacToeEngine::TTT::CONFIG.players.keys.first.to_s,\n :value => TicTacToeEngine::TTT::CONFIG.players[TicTacToeEngine::TTT::CONFIG.players.keys.first][:value]},\n {:id => TicTacToeEngine::TTT::CONFIG.pieces[:x], :name => TicTacToeEngine::TTT::CONFIG.players.keys.last.to_s,\n :value => TicTacToeEngine::TTT::CONFIG.players[TicTacToeEngine::TTT::CONFIG.players.keys.last][:value]}]\n end", "def score=(value)\n @score = value\n end", "def score_round(scores={})\n\n return nil if scores.nil?\n return nil unless game.in_play?\n \n total = scores.values.inject(0){|score,value| score+value}\n\n return nil unless (total == 26 or total == 78)\n\n scores.each_pair do |name,score|\n playa = game.players.select{|p| p.name == name}.first\n pr = playa.player_rounds.select{|pr| pr.round_id == self.id}.first\n if pr\n pr.score = score\n pr.mon_shot = true if (total == 78 and pr.score == 0)\n pr.save\n end\n end\n\n game.calculate_totals\n \n end", "def add_score(level, name, score, mode)\n begin\n data = LEVELS[level].post high_score: { name: name, score: score, text: mode }\n HighScore.new(data)\n\n rescue RestClient::ResourceNotFound, JSON::ParserError, Errno::ETIMEDOUT, RestClient::RequestTimeout\n raise OnlineHighScores::NetworkError\n\n rescue RestClient::Forbidden # Score wouldn't get on the table, so was refused.\n nil\n\n ensure\n @cached_scores.delete level # Force reloading of the whole level scores.\n end\n end", "def update!(**args)\n @child_score = args[:child_score] if args.key?(:child_score)\n @csai_score = args[:csai_score] if args.key?(:csai_score)\n @csam_a1_score = args[:csam_a1_score] if args.key?(:csam_a1_score)\n @csam_age_indeterminate_score = args[:csam_age_indeterminate_score] if args.key?(:csam_age_indeterminate_score)\n @iu_inappropriate_score = args[:iu_inappropriate_score] if args.key?(:iu_inappropriate_score)\n @medical_score = args[:medical_score] if args.key?(:medical_score)\n @pedo_score = args[:pedo_score] if args.key?(:pedo_score)\n @porn_score = args[:porn_score] if args.key?(:porn_score)\n @racy_score = args[:racy_score] if args.key?(:racy_score)\n @semantic_sexualization_score = args[:semantic_sexualization_score] if args.key?(:semantic_sexualization_score)\n @spoof_score = args[:spoof_score] if args.key?(:spoof_score)\n @version = args[:version] if args.key?(:version)\n @violence_score = args[:violence_score] if args.key?(:violence_score)\n @yt_porn_score = args[:yt_porn_score] if args.key?(:yt_porn_score)\n end", "def create_scores\r\n\r\n end", "def starter?\n games_played < Elo.config.starter_boundry\n end", "def update_scoreboard(scores = {})\n end", "def playLevel (n)\n\t\n\tlvl = ((n - 1) % NUM_LEVELS)\n\n\toldPoints = $points\n\n\t# start = Time.now\n\n\troundPoints = 0\n\n\tputs \"You have #{$timeAvailable} seconds to score at \" \\\n\t\t\"least #{$currLevel} points.\\nGood luck!\"\n\n\tcase lvl\n\twhen 0\n\t\tputs \"Write the color, not the word\"\n\twhen 1\n\t\tputs \"Write the word, not the color\"\n\twhen 2\n\t\tputs \"Write the color, followed by the word\"\n\twhen 3\n\t\tputs \"Write the word, followed by the color\"\n\twhen 4\n\t\tputs \"Write the first color, then the second word\"\n\twhen 5\n\t\tputs \"Write the first word, then the second color\"\n\twhen 6\n\t\tputs \"Write the complement color\"\n\twhen 7\n\t\tputs \"Write the complement word\"\n\telse\n\t\tputs \"ERROR in playLevel directions\"\n\t\treturn\n\tend\n\n\t#start the level timer\n\tstart = Time.now\n\n\twhile (Time.now < (start + $timeAvailable))\n\n\t\tif (((Time.now - start) % 10) == 0)\n\t\t\tputs \"\\t\\t#{ime.now - start} seconds remaining\"\n\t\tend\n\n\t\tcase lvl\n\t\twhen 0\n\t\t\troundPoints += singleColor()\n\t\twhen 1\n\t\t\troundPoints += singleWord()\n\t\twhen 2\n\t\t\troundPoints += colorThenWord()\n\t\twhen 3\n\t\t\troundPoints += wordThenColor()\n\t\twhen 4\n\t\t\troundPoints += firstColorSecondWord()\n\t\twhen 5\n\t\t\troundPoints += firstWordSecondColor()\n\t\twhen 6\n\t\t\troundPoints += complementColor()\n\t\twhen 7\n\t\t\troundPoints += complementWord()\n\t\telse \n\t\t\tputs \"ERROR in playLevel selection\"\n\t\t\treturn\n\t\tend\n\n\t\t#early exit option if points satisfied\n\t\tif (roundPoints == $currLevel)\n\t \t\tputs \"---POINT LEVEL REACHED---\\nSkip ahead? (y/n)\"\n\t \t\tc = gets.chomp\n\t \t\tif (c == \"y\")\n\t \t\t\tbreak\n\t \t\tend\n\t \tend\n\tend\n\n\tputs \"LEVEL OVER\".cyan()\n\n\t# BUG: Write the color, not the word\n\t# cyan\n\t# red\n\t# LEVEL OVER\n\t# Good job!\n\t# Please enter 's' to start or 'q' to quit\n\n\t# Please enter in a valid command!\n\t# Please enter 's' to start or 'q' to quit\n\t\t#maybe I hit enter twice?\n\n\t#Another BUG:\n\t#User keeps on hitting enter\n\n\n\tif ($currLevel > roundPoints)\n\t\tputs \"You lose!\".red()\n\t\t$continue = false\n\telse\n\t\tputs \"Good job!\".green()\n\t\t$currLevel += 1\n\t\t$points += roundPoints\n\t\tif ($timeAvailable > 10)\n\t\t\t$timeAvailable -= 5\n\t\tend\n\tend\n\nend", "def build_details\n details = CompareScore.new(\n ::RubyCritic::Config.base_branch,\n ::RubyCritic::Config.feature_branch,\n ::RubyCritic::Config.base_branch_score.to_f.round(2),\n ::RubyCritic::Config.feature_branch_score.to_f.round(2)\n ).message\n\n Skunk::Command::Output.create_directory(::RubyCritic::Config.compare_root_directory)\n File.open(build_details_path, \"w\") { |file| file.write(details) }\n puts details\n end", "def load_settings\n dir = 'Wave_Trace'\n \n dict = Sketchup.active_model.attribute_dictionary(dir)\n return if !dict # No saved settings\n\n # Set the global options\n @draw_realtime_check.checked = dict['draw_realtime']\n @bounce_hidden_check.checked = dict['bounce_hidden']\n @max_length_drop.value = dict['max_length']\n # @use_barrier_check.checked = dict['use_barrier']\n @max_bounces_drop.value = dict['max_bounces']\n @bounce_filter_drop.value = dict['bounce_filter']\n # @draw_sweetspot_check.checked = dict['draw_sweetspot']\n \n # Now load any speaker settings\n s_index = 0\n while(speaker_str = dict[\"s_#{s_index}\"]) # There is a saved speaker at s_x in attribute dictionary\n \n # Create a speaker and set its values according to the saved information\n speaker_hash = eval(speaker_str)\n speaker = self.add_speaker(true) # Add a speaker with the 'loading' option set to TRUE (avoids creating any drivers)\n \n speaker.name_field.value = speaker_hash[:name]\n speaker.name_field.trigger_event(:textchange)\n \n speaker.realtime_check.checked = speaker_hash[:realtime_check]\n speaker.commit_check.checked = speaker_hash[:commit_check]\n speaker.group_num = speaker_hash[:group_num]\n # Set the link_to_group droplist value to whatever the group_num index is. Then set a color if there is a group.\n # speaker.link_to_group_drop.value = speaker.link_to_group_drop.items[speaker.group_num] if speaker.group_num\n # case speaker.group_num\n # when 1\n # speaker.group_highlight.background_color = Sketchup::Color.new(128,0,0,255) # Red\n # when 2\n # speaker.group_highlight.background_color = Sketchup::Color.new(0,128,0,255) # Green\n # when 3\n # speaker.group_highlight.background_color = Sketchup::Color.new(128,128,0,255) # Yellow\n # when 4\n # speaker.group_highlight.background_color = Sketchup::Color.new(200,200,200,255) # White\n # end\n \n d_index = 0\n while(driver_str = dict[\"s_#{s_index}_d_#{d_index}\"]) # There is a saved driver at s_x_d_x in attribute dictionary\n # Create a driver and set its values according to the saved information\n driver_hash = eval(driver_str)\n driver = speaker.add_driver(true) # Add a driver with the 'loading' option set to TRUE (avoids any group settings logic)\n \n driver.name_field.value = driver_hash[:name]\n driver.name_field.trigger_event(:textchange)\n\n origin_array = driver_hash[:origin]\n vector_array = driver_hash[:vector]\n if origin_array.empty? # No saved origin... it was never set\n driver.origin = nil\n driver.vector = nil\n else # Found an origin... so there has to be a vector as well. Load both and change \"locate driver\" button to reflect such.\n driver.origin = Geom::Point3d.new(origin_array)\n driver.vector = Geom::Vector3d.new(vector_array)\n driver.locate_button.background_color = Sketchup::Color.new(0, 0, 0, 128) # Un-highlight locate_button\n driver.locate_button.caption = \"Relocate\" # Change its caption\n end\n \n driver.realtime_check.checked = driver_hash[:realtime_check]\n driver.commit_check.checked = driver_hash[:commit_check]\n \n driver.density_drop.trigger_event(:change, driver_hash[:density], true) # Call the density change to update angle droplists\n driver.x_angle_low_drop.value = driver_hash[:x_angle_low]\n driver.x_angle_high_drop.value = driver_hash[:x_angle_high]\n driver.y_angle_low_drop.value = driver_hash[:y_angle_low]\n driver.y_angle_high_drop.value = driver_hash[:y_angle_high]\n driver.x_angle_link_check.checked = driver_hash[:x_angle_link]\n driver.y_angle_link_check.checked = driver_hash[:y_angle_link]\n driver.ray_list = driver_hash[:ray_list]\n \n d_index += 1\n end\n s_index += 1\n end\n \n self.select_speaker(@speaker_list.first) if speaker_list.length > 0\n end", "def jackpot_general\n \tscore_boards_type_0 = ScoreBoard.active.where(board_type: ScoreBoard::GENERAL, is_active: true).count\n\n \treturn (score_boards_type_0 * ScoreBoard::GENERAL_VALUE)\n end", "def run\n return unless profile\n\n @locked = true\n\n log :info, \"StackProf#{config.raw? ? \" (raw)\" : \"\"} enabled globally: \" \\\n \"mode – #{config.mode}, target – #{config.target}\"\n\n at_exit { dump(\"total\") } if config.suite?\n end", "def assign_score; end", "def call_cheat\n if (@score >= 100 and !@cheat)\n @score -= 100\n @cheat = true\n end\n end", "def setup_winners_right_now\n # create a Hash with ongoing games\n @honorable_hash = Hash.new\n @games.each do |g|\n if g.started?\n tips = Tip.joins(:user).where(\"game_id =? and home_score = ? and away_score = ?\", g.id, g.home_score, g.away_score).order(\"users.points DESC\")\n @honorable_hash[g.id] = tips\n end\n end\n end", "def analyze!\n if nova_score_above_threshold?\n APPROVE_VALUE\n else\n DENIAL_VALUE\n end\n end", "def build(options = {}, & block)\n require 'limelight/dsl/prop_builder'\n builder = Limelight::DSL::PropBuilder.new(self)\n builder.__install_instance_variables(options)\n builder.__root_path__ = scene.path\n builder.instance_eval(& block)\n end", "def load_settings\n @leaderboard_settings = component.settings\n end", "def load_settings\n @leaderboard_settings = component.settings\n end", "def setup!( options )\n self.level = options[:level]\n end", "def quality_control(answer)\n\tif answer == \"cheat code\"\n\t\tsession[\"p1_total_score\"] = 100 - 1 \n\t\treturn true\n\telsif answer == \"rock\" or answer == \"scissors\" or answer == \"paper\"\n\t\treturn true\n\telse\n\t\treturn false\n\tend\t\nend", "def calcScore(mod)\n #if we've already seen this combination, why score it again?\n id = mod.names.sort.join(\"--\")\n if @allScores.key?(id)\n return @allScores[id]\n else\n #new - score it and return it\n score = mod.score\n @allScores[id] = score\n return score\n end\nend", "def calc_optimize_score(actor, compare_actor)\n score = 0\n total_score = 0\n \n score = compare_actor.maxhp - actor.maxhp\n if @mode.include?(MENU_CONFIG::OPTIMIZE_HP)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.maxmp - actor.maxmp\n if @mode.include?(MENU_CONFIG::OPTIMIZE_MP)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.atk - actor.atk\n if @mode.include?(MENU_CONFIG::OPTIMIZE_ATK)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.def - actor.def\n if @mode.include?(MENU_CONFIG::OPTIMIZE_DEF)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.spi - actor.spi\n if @mode.include?(MENU_CONFIG::OPTIMIZE_SPI)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.agi - actor.agi\n if @mode.include?(MENU_CONFIG::OPTIMIZE_AGI)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.eva - actor.eva\n if @mode.include?(MENU_CONFIG::OPTIMIZE_EVA)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.hit - actor.hit\n if @mode.include?(MENU_CONFIG::OPTIMIZE_HIT)\n score *= 2\n end\n total_score += score\n \n score = compare_actor.cri - actor.cri\n if @mode.include?(MENU_CONFIG::OPTIMIZE_CRI)\n score *= 2\n end\n total_score += score\n \n return total_score\n end", "def score=(points)\n s = points\n s = 0 if s < 0\n s = 100 if s > 100\n self[:score] = s\n rerank\n end", "def initialize( ptScore )\n @ptScore = ptScore\n @modifier = determineModifier\n end", "def judge_scores?\n standard_skill_score_entries.any?\n end", "def print_complexity_scores(filename, scores)\n critical_scores = 0\n unless @options[:dev]\n puts 'Complexity'.rjust(10) + ' | ' + 'Method name'.ljust(50)\n puts '-----------------------------------------------------------------'\n end\n scores[:per_method].each do |res|\n if res[:complexity].to_i > 60\n if (critical_scores == 0) && (@options[:dev])\n puts\n @options[:jenkins] ?\n puts(\"=== #{filename} ===\") :\n puts(\"=== #{filename} ===\".bold)\n puts 'Complexity'.rjust(10) + ' | ' + 'Method name'.ljust(50)\n puts '-------------------------------------------------------------'\n end\n critical_scores += 1\n @options[:jenkins] ?\n puts(\"#{res[:complexity].rjust(10)} | #{res[:method]}\") :\n puts(\"#{res[:complexity].rjust(10).red} | #{res[:method].red}\")\n elsif res[:complexity].to_i > 25\n if (critical_scores) == 0 && (@options[:dev])\n puts\n @options[:jenkins] ?\n puts(\"=== #{filename} ===\") :\n puts(\"=== #{filename} ===\".bold)\n puts 'Complexity'.rjust(10) + ' | ' + 'Method name'.ljust(50)\n puts '--------------------------------------------------------------'\n end\n critical_scores += 1\n @options[:jenkins] ?\n puts(\"#{res[:complexity].rjust(10)} | #{res[:method]}\") :\n puts(\"#{res[:complexity].rjust(10).yellow} | #{res[:method].yellow}\")\n else\n unless @options[:dev]\n puts \"#{res[:complexity].rjust(10)} | #{res[:method]}\"\n end\n end\n end\n unless @options[:dev]\n puts '------------------------------------------------------------------'\n puts \"#{scores[:total]}\".rjust(10) + ' | ' + 'Total'\n end\n end", "def recompute_scores\n point_attribution_all\n Section.all.each do |s|\n \ts.max_score = 0\n \tif !s.fondation?\n \t\ts.problems.each do |p|\n \t\t\tif p.online?\n\t\t \t\t\ts.max_score = s.max_score + p.value\n\t\t \t\tend\n\t\t \tend\n\t\t \ts.chapters.each do |c|\n\t\t \t\tif c.online?\n\t\t \t\t\tc.exercises.each do |e|\n\t\t \t\t\t\tif e.online?\n\t\t \t\t\t\t\ts.max_score = s.max_score + e.value\n\t\t \t\t\t\tend\n\t\t \t\t\tend\n\t\t \t\t\tc.qcms.each do |q|\n\t\t \t\t\t\tif q.online?\n\t\t \t\t\t\t\ts.max_score = s.max_score + q.value\n\t\t \t\t\t\tend\n\t\t \t\t\tend\n\t\t \t\tend\n\t\t \tend\n\t\t end\n \ts.save\n end\n redirect_to users_path\n end", "def formulate_score()\n @player_score = @player_score.sort!().reverse!().join().to_i()\n p \"#{@players[0].get_name}'s score is #{@player_score}\"\n check_score()\n end", "def set_determine_set_winner()\n @score_count.set_determine_set_winner()\n end", "def gtm_score\n super\n end", "def set_other_games_won()\n @score_count.set_other_games_won()\n end", "def initialize\n @score = 0; #inicializa el puntaje en 0\n end", "def evaluate(player, computer)\n # `#{scores.key scores[:player1_name]} wins!`\n if player == computer\n return \"It's a draw!\"\n else\n if player == \"Rock\"\n if computer == \"Paper\"\n score = $scores[:player2_name].to_i\n score += 1\n $scores[:player2_name] = score\n return \"Computer wins!\"\n else\n score = $scores[:player1_name].to_i\n score += 1\n $scores[:player1_name] = score\n return \"#{$scores.key $scores.fetch(:player1_name)} wins!\"\n end\n elsif player == \"Paper\"\n if computer == \"Scissors\"\n score = $scores[:player2_name].to_i\n score += 1\n $scores[:player2_name] = score\n return \"Computer wins!\"\n else\n score = $scores[:player1_name].to_i\n score += 1\n $scores[:player1_name] = score\n return \"#{$scores.key $scores.fetch(:player1_name)} wins!\"\n end\n else\n if computer == \"Rock\"\n score = $scores[:player2_name].to_i\n score += 1\n $scores[:player2_name] = score\n return \"Computer wins!\"\n else\n score = $scores[:player1_name].to_i\n score += 1\n $scores[:player1_name] = score\n return \"#{$scores.key $scores.fetch(:player1_name)} wins!\"\n end\n end\n end\nend", "def initialize\n set_name # generally not a good idea to include logic in initialize method, so will encapsulate that logic into set_name method\n @score = 0\n end", "def fb_use_rules(number)\n result = ''git\n result << RULES.each_key.inject('') { |memo, k| memo << RULES[k] if number.divisible_by?(k) ; memo }\n result.empty? ? number : result\nend", "def gain_points\n @score += 1\n end", "def update_score!\n entries = leaderboards.to_a.map do |lb|\n lb.entrys.where(user: self).last\n end\n\n value = entries.map { |e| e.leaderboard.scored ? Score.value(e.rank) : 0 }.reduce(:+)\n\n update(score: value)\n\n value\n end", "def calculateScore\n\t\tif @game\n @score += [@gridPick.associatedTimer-@game.time,0].max\n\t\telse\n\t\t\t@score = 0\n\t\tend\n\tend", "def update_score_from_games!\n return if self.games.count == 0\n score_by_steam_id = {}\n self.games.each do |g|\n # Add one point to winning team, 0 to losing team so that they show up in the keyset when we check later\n if g.radiant_win === true\n score_by_steam_id[g.radiant_team_id] = score_by_steam_id[g.radiant_team_id].to_i + 1\n score_by_steam_id[g.dire_team_id] = score_by_steam_id[g.dire_team_id].to_i\n elsif g.radiant_win === false\n score_by_steam_id[g.radiant_team_id] = score_by_steam_id[g.radiant_team_id].to_i\n score_by_steam_id[g.dire_team_id] = score_by_steam_id[g.dire_team_id].to_i + 1\n end\n end\n\n # OK the keys are team ids, so now save them\n if score_by_steam_id[self.home_participant.id] != nil && score_by_steam_id[self.away_participant.id] != nil\n self.home_score = score_by_steam_id[self.home_participant.id]\n self.away_score = score_by_steam_id[self.away_participant.id]\n self.save!\n else\n puts score_by_steam_id.inspect\n puts self.home_participant_id.inspect\n puts self.away_participant_id.inspect\n puts \"WARNING: teams did not match, not updating match score\"\n end\n end", "def score\n calculator.score\n end", "def game\n {\n starting_decision: :stormy_night,\n decisions: {\n stormy_night: {\n description: 'It was a dark and stormy night. (storyline located in decision.rb)',\n option_one: {\n description: 'Go to sleep.',\n decision: :nap\n },\n option_two: {\n description: 'Watch a movie.',\n decision: :movie\n },\n option_three: {\n description: 'Go outside.',\n decision: :go_outside\n },\n option_four: {\n description: 'Get a snack.',\n decision: :get_a_snack\n }\n },\n nap: {\n description: 'You took a nap. The end.',\n option_one: {\n description: 'Start over.',\n decision: :stormy_night\n }\n }\n }\n }\nend", "def default_score\n HappyMapperTools::Benchmark::ScoreType.new('urn:xccdf:scoring:default', 100, score_benchmark_default)\n end", "def score\n properties['score']\n end", "def set_score(num, socre)\n @game[num] = score\n end", "def clamps_enabled?\n return false unless options[:scale]\n\n options[:scale][:num_nonroot_users] ||\n options[:scale][:daemonize] ||\n options[:scale][:static_files] ||\n options[:scale][:dynamic_files]\nend", "def score_for( kinployee )\n @kinployee = kinployee\n @kinployee_backgrounds = @kinployee.cultural_backgrounds\n @kinployee_match_preference = @kinployee.culture_match_preference\n\n kinployment_score = case @kinployment_match_preference\n when 'no_preference' then 1.0\n when 'similar' then kinployment_similar_culture_score\n when 'not_similar' then kinployment_dissimilar_culture_score\n end\n\n kinployee_score = case @kinployee_match_preference\n when 'no_preference' then 1.0\n when 'similar' then kinployee_similar_culture_score\n when 'not_similar' then kinployee_dissimilar_culture_score\n end\n\n kinployment_score * kinployee_score\n end", "def valid_init_turn(accumulated_score)\n # if intial turn accumulated_score < 300, scores are not stored\n if @allowed == false && accumulated_score >= 300\n @allowed = true\n puts 'Turn score >= 300. Now your scores will be stored'\n elsif @allowed == false\n accumulated_score = 0\n puts \"Initial turn score < 300. Your scores won't be counted yet\"\n end\n accumulated_score\n end", "def profile_builder\n @profile_builder ||=\n begin\n curtailment = @config.production_curtailment || 0.0\n\n if curtailment.positive? && @config.group.to_s.starts_with?('self:')\n raise 'Cannot use non-zero production_curtailment with a ' \\\n \"\\\"self:...\\\" curve in #{@node.key}\"\n end\n\n CurtailedProfile.new(\n @context.curves.curve(@config.group, @node),\n curtailment\n )\n end\n end", "def startup_performance_score=(value)\n @startup_performance_score = value\n end", "def weight\n (kyc_level == 'any' ? 0 : 10) + (group == 'any' ? 0 : 1)\n end", "def allergy_score(score)\n scorecard = {\n 128 => \"cats\",\n 64 => \"pollen\",\n 32 => \"chocolate\",\n 16 => \"tomatoes\",\n 8 => \"strawberries\",\n 4 => \"shellfish\",\n 2 => \"peanuts\",\n 1 => \"eggs\"\n }\n \n allergies = []\n\n if score == 0\n puts \"No allergies\"\n else\n scorecard.each do |key, value|\n if score >= key\n allergies.push(value)\n score -= key\n end\n end\n p allergies\n end\nend", "def set_games_won()\n @score_count.set_games_won()\n end", "def initialize(options = { })\n\t\t\t# Assumes that there is a file called \"tuneable.txt\" in a \"data\" subdirectory of\n\t\t\t# the superdirectory of this script\n\t\t\tdefault_tuneable_file = File.open(File.dirname(File.expand_path(__FILE__)) + \"/../data/tuneable.txt\")\n @options = options\n self.prime_weights =\toptions[:prime_weights] || PRIMES.dup\n @pc_only = \toptions[:pc_only] || false\n @tuneable_file = \toptions[:tuneable_file] || default_tuneable_file\n \n pattern = /(\\d+)\\/(\\d+)/\n # Reads in the entire list of tuneable intervals from a file\n File.open(@tuneable_file) do |intervals|\n @tuneable = intervals.readlines.inject([]) do |tuneable, line|\n\t\t\t\t\t# If the line doesn't contain a matching pattern, it skips over that line by\n\t\t\t\t\t# returning the unaltered memo.\n\t\t\t\t\tpattern =~ line ? (tuneable << HD::Ratio[$1.to_i, $2.to_i]) : tuneable\n end\n end\n end", "def work_from_anywhere_score=(value)\n @work_from_anywhere_score = value\n end", "def handle_spare(score)\n return unless self.spare\n self.apply_extra_score(score) if self.extra_turns_applied.to_i != 1\n end", "def init_core_game(options)\r\n if options[:netowk_core_game]\r\n # we are on network game, use NAL class for core game\r\n @core_game = options[:netowk_core_game]\r\n @core_game.set_custom_core( create_instance_core() )\r\n @core_game.custom_core.create_deck\r\n @log.debug \"using network core game\"\r\n elsif options[:custom_deck]\r\n @core_game = create_instance_core()\r\n @log.debug \"using local cpu core CUSTOM deck\"\r\n @core_game.rnd_mgr = options[:custom_deck][:deck]\r\n # say to the core we need to use a custom deck\r\n @core_game.game_opt[:replay_game] = true \r\n else\r\n # local game\r\n @core_game = create_instance_core()\r\n @core_game.set_specific_options(options)\r\n @log.debug \"using local cpu core\"\r\n @mnu_salva_part.enable if @mnu_salva_part\r\n end\r\n end", "def scratch_build\n require 'polisher/targets/koji'\n\n in_repo do\n Koji.build :srpm => srpm,\n :scratch => true\n end\n self\n end", "def include?(score)\n if self.root.nil?\n return false\n else\n recursive_include?(self.root, score)\n end\n end" ]
[ "0.55239743", "0.5172838", "0.50185764", "0.49578756", "0.48621836", "0.48131984", "0.47761005", "0.47544083", "0.47504866", "0.47458765", "0.46919346", "0.4677389", "0.46730867", "0.4667838", "0.46658063", "0.46630818", "0.4653106", "0.46260557", "0.46077943", "0.46077755", "0.4606401", "0.4605477", "0.46001953", "0.4596388", "0.4586094", "0.45775214", "0.45598453", "0.45595783", "0.4548091", "0.4538366", "0.4530092", "0.45264095", "0.4520241", "0.45199013", "0.45187005", "0.45186707", "0.45184112", "0.45144033", "0.45046553", "0.45006528", "0.4489827", "0.44867775", "0.44840527", "0.44750413", "0.44747698", "0.4474567", "0.44715753", "0.44714418", "0.44677842", "0.4460005", "0.44524682", "0.44515508", "0.44472402", "0.44452047", "0.4444018", "0.4443731", "0.4442269", "0.44350365", "0.44337663", "0.44337663", "0.44192815", "0.44073653", "0.4402586", "0.44021997", "0.44013432", "0.43992245", "0.43976364", "0.43897164", "0.43896818", "0.4387959", "0.4386399", "0.4384136", "0.43834502", "0.4380302", "0.4377924", "0.4377569", "0.43753576", "0.43741167", "0.4372474", "0.43693852", "0.43629232", "0.43616858", "0.43573895", "0.43546507", "0.43515843", "0.43480185", "0.43421784", "0.43385926", "0.43379077", "0.43378788", "0.43372503", "0.43355367", "0.433312", "0.43306282", "0.4329919", "0.43289676", "0.43283466", "0.43276104", "0.43196803", "0.43165478" ]
0.5560613
0
def text_decoder_instance Cardtec::TextDecoder.new(self) end
def update_from_text_decoder(text_decoder) new_props = text_decoder.to_hash labels = new_props.delete(:labels) neo_id = new_props.delete(:neo_id) new_and_old_props = neo_node.props.slice(*Cardtec::Node::PROPERTIES_TO_KEEP).merge(new_props.symbolize_keys) neo_node.props = new_and_old_props neo_node.set_label(*labels) if labels.present? notify_to_after_save_listeners end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decoded_text\n @decoded_text ||= text.wukong_decode\n end", "def decoded_text\n @decoded_text ||= text.wukong_decode\n end", "def decode(text); end", "def he_decode(text); self.class.he_decode text; end", "def initialize(text)\n @text = text\n end", "def initialize(text)\n @text = text\n end", "def initialize(text)\n @text = text\n end", "def initialize(text)\n @text = text\n end", "def initialize(text)\n @text = text.to_s\n end", "def initialize(text)\n @text = text.to_s\n end", "def initialize(text)\n @text = text\n end", "def initialize(name, text)\r\n super(name)\r\n @text = text.to_s\r\n end", "def set_decoder\n @decoder = Decoder.find(params[:id])\n end", "def initialize\n STDOUT.sync = true\n require \"linguist\"\n self.lang = Linguist.detect(Linguist::Blob.new \"\", self.class.instance_variable_get(:@paste))&.name\n end", "def initialize text\n @filters = Despamilator::Filter.new text\n end", "def get_text_encoder\n case @config['text_encoder']\n when 'BasicArabicEncoder'\n Encoders::BasicArabicEncoder.new(@config['text_cleaner'])\n when 'ArabicEncoderWithStartSymbol'\n Encoders::ArabicEncoderWithStartSymbol.new(@config['text_cleaner'])\n else\n raise Exception.new(\n 'text_encoder not found: ' + @config['text_encoder'].to_s\n )\n end\n end", "def initialize(text = \"\")\n @text = text\n end", "def initialize(text, options = {})\n super options\n @text = text\n end", "def initialize\n @text = \"\"\n end", "def decode; end", "def decode; end", "def initialize(text, options = {})\n @text = text\n @options = options\n end", "def decode\n @msglen = plain_text.length\n holes = compute_holes(@msglen)\n\n end", "def text(*args)\n Text.new(self, *args)\n end", "def initialize(text=nil)\n @text = text\n @type=nil\n @copy=nil\n @target=nil\n parse unless @text.nil?\n end", "def initialize(text = \"\")\n @text = text\n reset!\n end", "def acrostic_decoder(coded_message)\n # write code here \nend", "def initialize(text)\n @scanner = StringScanner.new(text)\n @state = :start\n end", "def initialize(text, duration)\n @text = text\n @duration = duration\n end", "def initialize(text, duration)\n @text = text\n @duration = duration\n end", "def decode\n raise NotImplementedError\n end", "def initialize(type,text)\n\t\t@type = type\n\t\t@text = text\n\tend", "def decrypt\n self\n end", "def _init enc\n @_external_encoding = enc\n _init_converter\n end", "def texte_entier\n @texte_entier ||= TextAnalyzer::Analyse::WholeText.new(self)\n end", "def initialize(type,text)\r\n\t\t@type = type\r\n\t\t@text = text\r\n\tend", "def text_extractor\n TEXT_EXTRACTOR\n end", "def initialize(type,text)\n @type = type\n @text = text\n end", "def decrypt\n self\n end", "def text\n txt = @text\n if @compressed\n txt = PngMethods::inflate(@text)\n end\n\n if @international\n txt.force_encoding(\"UTF-8\")\n else\n txt.force_encoding(\"ISO-8859-1\")\n end\n end", "def initialize(code_string = nil)\n @cipher = parse_input(code_string)\n @@symbols = [:r, :g, :b, :y, :o, :p]\n end", "def initialize( textgenerator = StringRandomizer.new() )\n @texter = textgenerator\n end", "def decode\n transform :decode\n end", "def acrostic_decoder!(coded_message)\n # write code here \nend", "def parse_from_text(text)\n parser = TextParser.new\n parser.parse_text(text, self)\n return self\n end", "def text_injector\n TEXT_INJECTOR\n end", "def initialize(text, context=nil)\n\t\t\tcontext ||= {:source => '--'}\n\t\t\t@raw = PARSER.parse text\n\t\t\t@context = context\n\t\t\ttf = PARSER.terminal_failures\n\t\t\tif !@raw.respond_to?(:evaluate) then\n\t\t\t\treason = \"Incorrect macro syntax\"\n\t\t\t\terr = \"#{reason}\\n -> #{@context[:source]} [Line #{PARSER.failure_line}, Column #{PARSER.failure_column}]\"\n\t\t\t\t@context[:document].errors << err if @context[:document] && !@context[:embedded]\n\t\t\t\traise Glyph::SyntaxError, err\n\t\t\tend\n\t\t\t@document = Glyph::Document.new @raw, @context\n\t\t\t@document.inherit_from @context[:document] if @context[:document]\n\t\tend", "def initialize(ttf_filename, ptheight)\n EZDraw.requires_init\n\n @font = SDL2::Ttf.TTF_OpenFont(ttf_filename, ptheight)\n raise \"TTF_OpenFont: #{SDL2::Ttf.TTF_GetError}\" if @font.null? \n\n # wrapping in array to make changes shared by all references\n @destroyed_flag = [false]\n ObjectSpace.define_finalizer(self, proc {|id|\n self.class.class._destroy(@font, @destroyed_flag)\n })\n\n @@instances << self\n end", "def initialize\n self.cipher = AesCipher.new\n end", "def decode_string(str)\n\nend", "def text(text,tag_parse=true)\n set RGhost::Text.new(text.to_s,tag_parse) \n end", "def initialize(text, text_height, font_name, z=0)\n\t\tsuper(text, text_height, font_name, z)\n\t\t@img = create_text_content(text, text_height, font_name)\n\t\t@bg_width = @img.width + @@bg_margin\n\tend", "def initialize(text, id: nil)\n @text = text\n @id = id || generate_id\n end", "def initialize(text: ,delimeter: TxtMine::Strategy::PunctuationDelimeter, stop_words: STOP_WORDS, downcase: true, doc_id: self.class.get_next_doc_id)\n @text, @delimeter, @stop_words, @downcase, @doc_id = text, delimeter, stop_words, downcase, doc_id\n @stop_words ||= []\n @delimited, @cased, @filtered = false, false, false\n self.class.next_doc_id = doc_id + 1 if doc_id != @@next_doc_id - 1\n\n end", "def initialize(options={})\n defaults = {:text => \"\", :compress => false}\n options = defaults.merge options\n @text = options[:text] != nil ? options[:text] : ''\n @compress = options[:compress] != nil ? !!options[:compress] : false\n \n @output = \"\"\n @open_tags = []\n @indent_token = \"\"\n @current_level = 0\n @previous_level = nil\n @line_number = 0\n @embedding_token = '`'\n \n if @text != \"\"\n self.compile\n end\n end", "def decoder_stub(state)\n\t\tstate.key = \"\"\n\t\tstate.decoder_key_size = 0\n\t\tRex::Encoder::NonUpper::gen_decoder()\n\tend", "def initialize(input_text = nil)\n @engine = LexerEngine.new\n\t\t@queue = TokenQueue.new\n engine.input = input_text unless input_text.nil?\n end", "def parse(ical, context)\n return wrong_parser!(ical, context, \"#{ical} is not a Text value\") unless is_parser_for?(ical)\n return Text.new(unescape(ical))\n end", "def infer_language(text)\n raise \"Not Implemented. Class #{self.class.name} doesn't implement infer_language\"\n end", "def parse text\n raise \"No parser defined for #{self.class}\"\n end", "def text text\n end", "def initialize(text)\n @text = text.to_s.downcase.strip\n end", "def initialize(text)\n @points = 0\n @bad_matches = []\n @good_matches = []\n text = text.downcase\n allocate(text)\n end", "def cr\n self.class.new text.chomp + \"\\n\"\n end", "def initialize(text, length_to_display = 20)\n @length_to_display = length_to_display\n @text = text\n end", "def decoder_stub(state)\n len = state.buf.length \n\n decoder =\n \"\\xd9\\xee\" +\t\t\t # fldz \n \"\\xd9\\x74\\x24\\xf4\" +\t\t # fnstenv [esp - 0xc]\n \"\\x5f\" +\t\t\t # pop edi\n \"\\x83\\xc7\\x22\" +\t\t # add edi, 0x22\n \"\\x8d\\x37\" +\t\t\t # lea esi, [edi]\n \"\\x83\\xc6\" + [len].pack('C') + \t # add esi, (len + 1)\n \"\\x31\\xc0\" +\t\t\t # xor eax, eax\n \"\\x8a\\x07\" +\t\t\t # mov al, BYTE PTR [edi]\n \"\\x34X\" +\t\t\t # xor al, (xor key)\n \"\\x74\\x0b\" +\t\t\t # je +11 \n \"\\x8d\\x1e\" +\t\t\t # lea ebx, [esi]\n \"\\x01\\xc3\" +\t\t\t # add ebx, eax\n \"\\x8a\\x03\" +\t\t\t # mov al, BYTE PTR [ebx]\n \"\\x88\\x07\" +\t\t\t # mov BYTE PTR [edi], al\n \"\\x47\" +\t\t\t # inc edi\n \"\\xeb\\xef\"\t\t\t # jmp -17\n\n state.decoder_key_offset = 20\n\n return decoder\n end", "def initialize()\n super()\n @io = StringIO.new(\"\")\n @tags_chain = []\n @text = ''\n end", "def text=(str)\n @token = ::Ferret::Analysis::Token.new(\"\", 0, 0)\n @text = str\n @algor = Algorithm.new(@text)\n end", "def initialize(text)\n @text = text.dup\n @paragraphs = text.split(/\\n\\s*\\n\\s*/)\n @sentences = Lingua::EN::Sentence.sentences(@text)\n @words = []\n @frequencies = {}\n @frequencies.default = 0\n @syllables = 0\n @complex_words = 0\n count_words\n end", "def initialize(text)\n @text = text\n @sentences = []\n @result = {}\n @text.gsub!(\"\\n\", '')\n get_sentences\n get_words\n print_concordance\n end", "def initialize(chars_max=0, default=nil)\n @chars_max = (chars_max == 0 ? 1000 : chars_max)\n @char_widths = calculate_char_widths\n @cursor_width = CURSOR_WIDTH\n super(0, 0, 480, 64)\n self.contents = Bitmap.new(width - 32, height - 32)\n self.z += 9999\n self.opacity = 0\n @cursor_x = 0\n @text = Array.new\n if default != nil\n for i in 0...default.size\n @text[i] = default[i].chr\n @cursor_x += @char_widths[@text[i]]\n end\n @index = @text.size\n else\n @index = 0\n end\n @last_text = @text.clone\n refresh\n update_cursor_rect\n end", "def decode(options = {})\n decode!(options)\n rescue DeathByCaptcha::Error\n DeathByCaptcha::Captcha.new\n end", "def native_text\n unless @native_text\n preprocess_text @text\n end\n return @native_text\n end", "def initialize(description)\n @parse_tree = RE::Parser[ description ]\n @string = @parse_tree.to_s\n end", "def new\n @resource = Resource.new \n @text = Text.new\n end", "def initialize(type, text)\n @type, @text = type, text\n end", "def initialize(type, text)\n @type, @text = type, text\n end", "def initialize(key, text)\n super()\n @key = key\n @text = text\n end", "def get_text\n return self.text\n end", "def initialize(text, text_height, font_name, z=0)\n\t\t@text = text\n\t\t@text_height = text_height\n\t\t@font_name = font_name\n\n\t\t@z = z\n\n\t\t@x = 0\n\t\t@y = 0\n\n\t\t@text_colour = Gosu::Color::WHITE\n\t\t@background_colour = Gosu::Color::BLACK\n\n\t\t@bg_height = text_height + 2\n\tend", "def decode=(_arg0); end", "def decode=(_arg0); end", "def text= text\n @text = text\n @w,@h = @font.size_text text\n @surface = @font.render_blended text, @color\n render\n @text\n end", "def text(include_ocr: false)\n return @text if defined? @text\n\n @text = Henkei.read :text, data, include_ocr: include_ocr\n end", "def initialize(server_name, encoding, use_tls=false)\n @server_name = server_name\n @encoding = Encoding.find(encoding)\n @channels = {}\n @buffer = BufferedTokenizer.new(\"\\r\\n\")\n @use_tls = use_tls\n end", "def pfm_text\n return PFM::Text\n end", "def initialize(theme, text)\n @theme = theme\n @text = text\n @answers = {}\n end", "def decode data, encoding = nil\n if encoding.nil? || encoding == :plain\n data\n else\n send \"decode_#{encoding}\", data\n end\n end", "def initWithCoder decoder\n self.init\n self.message = decoder.decodeWithObjectForKey \"message\"\n self.id = decoder.decodeWithObjectForKey \"id\"\n self\n end", "def text(str); end", "def аватар text\n Data.emoji(text, exact: false, number: 0, lang: :ru)\n end", "def initialize (phrase_to_encode=\"\")\n\t\t@starting_phrase = phrase_content(phrase_to_encode)\n\t\t@one_time_phrase = \"\"\n\t\t@encrypted_message = \"\"\n\tend", "def initialize(name, options={})\n options = options.dup\n options[:decode] = DECODE\n options[:encode] = ENCODE\n super(name, options)\n end", "def initialize(name, options={})\n options = options.dup\n options[:decode] = DECODE\n options[:encode] = ENCODE\n super(name, options)\n end", "def initialize(metadata = {}, text = nil)\n @metadata = metadata\n @text = text\n end", "def from data\n obj = new\n obj.decode data\n obj\n end", "def instance\n @instance ||= LanguageParser.new\n end", "def get_text\n raise NotImplementedError\n end", "def create\n @decoder = Decoder.new(decoder_params)\n\n respond_to do |format|\n if @decoder.save\n format.html { redirect_to @decoder, notice: 'Decoder was successfully created.' }\n format.json { render action: 'show', status: :created, location: @decoder }\n else\n format.html { render action: 'new' }\n format.json { render json: @decoder.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(text)\n @headers = {}\n @http_version = ''\n @status = -1\n @response_text = ''\n \n parse text\n end", "def text; end" ]
[ "0.6798471", "0.6798471", "0.6736987", "0.64154917", "0.6335317", "0.6335317", "0.6268227", "0.6268227", "0.6238657", "0.6238657", "0.6235681", "0.5981813", "0.59749764", "0.5949045", "0.58993727", "0.58618313", "0.5852969", "0.58179134", "0.5808291", "0.5806802", "0.5806802", "0.5801978", "0.57568026", "0.56163996", "0.56163245", "0.5608854", "0.5593757", "0.556697", "0.55621547", "0.55621547", "0.55483794", "0.5531351", "0.55230486", "0.5514185", "0.55124944", "0.5496846", "0.54856217", "0.54817724", "0.5470656", "0.54633284", "0.54548335", "0.5448936", "0.54394585", "0.54116017", "0.5401323", "0.5393239", "0.53899866", "0.53857833", "0.53708345", "0.53251785", "0.52931094", "0.5291294", "0.52837616", "0.5263182", "0.5255811", "0.5236553", "0.52348673", "0.52275825", "0.5217589", "0.5214286", "0.52013856", "0.5195542", "0.5188131", "0.51842135", "0.51687306", "0.51466924", "0.5126913", "0.51256216", "0.51236826", "0.5119306", "0.51169026", "0.511182", "0.5109162", "0.5106823", "0.51058125", "0.5105045", "0.5105045", "0.50973517", "0.5093553", "0.50834", "0.50797313", "0.50797313", "0.5077182", "0.5073686", "0.507082", "0.5068934", "0.5060732", "0.5058347", "0.5052295", "0.5048039", "0.50474274", "0.50459766", "0.50384104", "0.50384104", "0.5036541", "0.50316244", "0.50286525", "0.50257987", "0.50057304", "0.5003426", "0.5002511" ]
0.0
-1
Function definitions Read in the names file
def readNames(path) return File.read(path).rstrip.split(/\n/).map{|r| r.downcase.split(/\|/)} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_functions src_file\n code = IO.readlines(src_file)\n functions = []\n puts src_file\n code.each do |line|\n /^\\s*def\\s+([^\\s\\(]+)\\s?.*/ =~ line\n functions << $1 if $1\n end \n functions\n end", "def functions\r\n functions = {}\r\n current = []\r\n \r\n lines = File.read(FUNCTIONS_FILE).split(\"\\n\")\r\n lines.each do |line|\r\n case line\r\n when / (\\w+) Functions /\r\n current = functions[$1] = []\r\n when / (\\w+) /\r\n current << $1\r\n else\r\n next\r\n end\r\n end\r\n \r\n functions\r\n end", "def readFile()\n\t#This is assuming the file name will be used\n\tfilename = 'names-data.txt'\n\topen(filename, 'r') {|f| f.read}\nend", "def read_files\r\n @prefixes = IO.read('prefixes.txt').split(' ')\r\n @syllables = IO.read('syllables.txt').split(' ')\r\n @postfixes = IO.read('postfixes.txt').split(' ')\r\n end", "def read_js_funcs \n Dir[\"#{@mjs_path}/_*.mjs\"].each do | file |\n fname = File.basename(file).sub(/^_(\\w+).mjs/, '\\1')\n\n open(file) do | f |\n @js_funcs[fname] = f.readlines\n end \n end\n end", "def symbols(file); end", "def symbols(file); end", "def LoadFile ()\n\t\n\tinput = \"\"\n\tFile.foreach(\"../Data Files/042-Words.txt\") {|x| input = x }\n\tnames = input.split(\",\")\n\t\n\treturn names;\nend", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def function_map\n unless @functions\n do_initialize\n @functions = {}\n function_files.each do |file|\n obj = {}\n name = File.basename(file, '.rb')\n obj[:name] = name\n obj[:parent] = mod_finder.match(file)[1]\n @functions[\"#{obj[:parent]}::#{name}\"] = obj\n end\n end\n @functions\n end", "def load_surnames(src)\n parse_file(src, \"surname\")\n end", "def read_file(filename); end", "def read_multi(*names); end", "def parse_file(filename); end", "def processTags(files)\n files.each do |file|\n count = 0\n File::readlines(file).each do |line|\n count+=1\n\n # function sym (\n line.gsub(/function ([\\w_$]+)([\\s]*)\\(/) {|match|\n puts $1 << \"\\t\" << file << \"\\t\" << '/' << match << '/' << ';\"'\n match\n }\n\n # obj.prototype.sym =\n line.gsub(/([\\w_$]+)\\.prototype\\.([\\w_$]+)([\\s]*)=/) {|match|\n puts $2 << \"\\t\" << file << \"\\t\" << '/' << match << '/' << ';\"'\n match\n }\n\n # this.sym = [new] [Ff]unction\n line.gsub(/this\\.([\\w_$]+)([\\s]*)=([\\s]*)(new[\\s])*[Ff]unction/) {|match|\n puts $1 << \"\\t\" << file << \"\\t\" << '/' << match << '/' << ';\"'\n match\n }\n\n # goog.namespace.sym =\n line.gsub(/goog\\.([\\w_$]+)\\.([\\w_$]+)([\\s]*)=/) {|match|\n puts $2 << \"\\t\" << file << \"\\t\" << '/' << match << '/' << ';\"'\n match\n }\n\n # sym : [new] [Ff]unction\n line.gsub(/([\\w_$]+)([\\s]*):([\\s]*)(new[\\s])*[Ff]unction[\\W]/) {|match|\n puts $1 << \"\\t\" << file << \"\\t\" << '/' << match << '/' << ';\"'\n match\n }\n end\n end\n return\nend", "def load_specification(file_name); end", "def definitions_at(filename, line, column); end", "def parse_name_file file\r\n #name_file = \"#{@giorno_flusso}\" + \"#{file.gsub \"MGP_\",\"MGP\"}\" + \".xml\" \r\n name_file = case file\r\n when /OffertePubbliche/ then \"#{@giorno}\" + \"#{file.gsub \"MGP_\",\"MGP\"}\" + \".zip\" \r\n when /MGP/ then \"#{@giorno}\" + \"#{file.gsub \"MGP_\",\"MGP\"}\" + \".xml\" \r\n when /MI1/ then \"#{@giorno}\" + \"#{file.gsub \"MI1_\",\"MI1\"}\" + \".xml\"\r\n when /MI2/ then \"#{@giorno}\" + \"#{file.gsub \"MI2_\",\"MI2\"}\" + \".xml\"\r\n when /MI3/ then \"#{@giorno}\" + \"#{file.gsub \"MI3_\",\"MI3\"}\" + \".xml\" \r\n when /MI4/ then \"#{@giorno}\" + \"#{file.gsub \"MI4_\",\"MI4\"}\" + \".xml\" \r\n when /MI5/ then \"#{@giorno}\" + \"#{file.gsub \"MI5_\",\"MI5\"}\" + \".xml\" \r\n end\r\n name_file\r\n end", "def print_names\n @file.each do |line|\n puts \"#{line[:first_name]} #{line[:last_name]} \"\n end\n end", "def read_grammar_defs(filename)\n puts 'Opening file ' + filename\n filename = 'grammars/' + filename unless filename.start_with? 'grammars/'\n filename += '.g' unless filename.end_with? '.g'\n contents = open(filename, 'r') { |f| f.read }\n contents.scan(/\\{(.+?)\\}/m).map do |rule_array|\n rule_array[0]\n end\nend", "def php_builtins\n out = {}\n\n download_and_read_docs do |file|\n title = Regexp.last_match[1] if file =~ /<title>(.*?) Functions<\\/title>/\n\n next unless title\n\n functions = file.scan(/<a href=\"function\\..*?\\.html\">(.*?)<\\/a>/)\n\n # The functions array looks like this:\n #\n # [[\"is_soap_fault\"],\n # [\"is_soap_fault\"],\n # [\"use_soap_error_handler\"],\n # [\"is_soap_fault\"]]\n #\n # Let's convert it to sth. like this:\n #\n # [\"is_soap_fault\"],\n # \"is_soap_fault\",\n # \"use_soap_error_handler\",\n # \"is_soap_fault\"]\n #\n functions.map!(&:first)\n\n out[title.to_sym] = functions.uniq\n end\n\n out\nend", "def read(files); end", "def read(files); end", "def read_grammar_defs(filename)\r\n filename = 'grammars/' + filename unless filename.start_with? 'grammars/'\r\n filename += '.g' unless filename.end_with? '.g'\r\n contents = open(filename, 'r') {|f| f.read}\r\n contents.scan(/\\{(.+?)\\}/m).map do |rule_array|\r\n rule_array[0]\r\n end\r\nend", "def all_names; end", "def all_names; end", "def filenames; end", "def fun_def fun\n\tDATA.rewind\n\tDATA.readlines.each do |line|\n\t\treturn line if line =~ /#{fun}/\n\tend\nend", "def read_src name\n IO.readlines('../src/' + name).collect{|c| \"\\t\" + c}\nend", "def flistr fname\n flist = []\n if fexistr fname\n eval \"$#{fname}.each\" do |i|\n sname,ftype = i.split \",\"\n if ftype.eq \"ref\"\n flist.push sname\n end \n end\n end\n return flist\nend", "def file name\n \n end", "def load_female_names(src)\n parse_file(src, \"female\")\n end", "def eval_file; end", "def name() @filename end", "def load_male_names(src)\n parse_file(src, \"male\")\n end", "def getNames()\n\t#open file\n\tf = File.open(\"names.txt\", \"r\")\n\t#initialize namear array\n\tnamear = []\n\tf.each_line do |line|\n\t\t#remove '\"' and line escapes\n\t\tline = line.gsub(/\"/,'').strip\n\t\t#split the line into individual names separating at ','\n\t\tnamear = line.split(',')\n\tend\n\t#close file\n\tf.close\n\t#return array\n\treturn namear\nend", "def filename \n end", "def read_grammar_defs(filename)\n filename = 'grammars/' + filename unless filename.start_with? 'grammars/'\n filename += '.g' unless filename.end_with? '.g'\n contents = open(filename, 'r') { |f| f.read }\n contents.scan(/\\{(.+?)\\}/m).map do |rule_array|\n rule_array[0]\n end\nend", "def rsg(filename)\n # TODO: your implementation here\n rawdef = read_grammar_defs(filename)\n spldef = split_definition(rawdef)\n gram = to_grammar_hash(spldef)\n expand(gram)\n #Calls each function independently so that there was no confusion when\n #writing each one\n\nend", "def read_from_file(iFileName)\n lStrFunction = nil\n if (File.exists?(iFileName))\n File.open(iFileName, 'r') do |iFile|\n lStrFunction = iFile.read\n end\n else\n raise RuntimeError.new(\"Missing file #{iFileName} to load function.\")\n end\n begin\n @Function = eval(lStrFunction)\n rescue Exception\n raise RuntimeError.new(\"Invalid function specified in file #{iFileName}: #{$!}\")\n end\n convertDataTypes\n optimize\n end", "def definitions; end", "def definitions; end", "def read_multi(names)\n names.map do |name|\n read(name)\n end\n end", "def definition_file_paths=(_arg0); end", "def split_function_name(line)\n /(\\s*def\\s*)(\\S[^\\(]*)(\\(.*)/.match(line)\nend", "def load(name); end", "def read_definitions\n definitions = []\n definitions_file = ARGV[0]\n $logger.info \"Reading user definitions from \\\"#{definitions_file}\\\"\"\n options = {:col_sep => DELIM, :headers => :first_row, :return_headers => false}\n CSV.foreach(definitions_file, options) do |row|\n next if row.empty?\n id = row[0].strip\n first_name = row[1].strip\n last_name = row[2].strip\n workspace = row[3].strip\n definitions << {id: id, first_name: first_name, last_name: last_name, workspace: workspace}\n end\n definitions\nend", "def defs(file, line, col); end", "def defs(file, line, col); end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def filename; end", "def in_file(filename); end", "def merge_names(*args)\n\tnames = {}\n\targs.each do |arg|\n\t\tFile.open(arg,'r') do |f|\n\t\t\twhile line = f.gets do\n\t\t\t\tnames[line.delane_sequence_name] = true\n\t\t\tend\n\t\tend\n\tend\n\tnames\nend", "def say_hi\n puts \"Hi \" + define_names\n end", "def funcify\n unless File.exists?('.projectProtoMap') and File.exists?('.projectFileMap')\n puts \"'.projectProtoMap' and/or '.projectFileMap' not found. Please run creatify first.\"\n exit(1)\n end\n\n File.open(\".projectProtoMap\", \"r\").each_line do\n |line|\n pMatch = line.match(/^(\\d+):(.*?)([^\\s^\\*]*)\\((.*)\\);$/)\n\n if pMatch\n puts \"Found prototype: #{line.chomp}\"\n project = pMatch[1]\n returnType = pMatch[2]\n funcName = pMatch[3]\n args = pMatch[4].scan(/(\\w+),|(\\w+)$/)\n args.length.times do\n |a|\n if args[a][0]\n args[a] = args[a][0]\n elsif args[a][1]\n args[a] = args[a][1]\n end\n end\n File.open(\".projectFileMap\", \"r\").each_line do\n |l2|\n fMatch = l2.match(/^(\\d+):\\s*(.*\\.c)$/)\n if fMatch && fMatch[1] == project\n puts \"Putting into file: #{l2.chomp}\"\n File.open(fMatch[2],\"w\") do\n |cfile|\n cfile.puts \"#include \\\"holberton.h\\\"\"\n cfile.puts\n cfile.puts \"/**\"\n cfile.puts \" * #{funcName} - function description\"\n args.each do\n |arg|\n cfile.puts \" * @#{arg}: parameter description\"\n end\n cfile.puts \" * Return: return description\" unless returnType == \"void \"\n cfile.puts \" */\"\n\n cfile.puts line.split(\":\")[-1].chomp.match(/([^;]*)/)[1]\n cfile.puts \"{\"\n cfile.puts \"\"\n cfile.puts \"}\"\n end\n end\n end\n puts \"\"\n end\n end\nend", "def unless_has_method(filepath, name)\n unless File.read(filepath) =~ /^\\s*def #{name}(\\(|\\s|\\n)/\n yield\n end\n end", "def build_Method_List(fpath_in, fpath_Out = nil)\r\n \r\n #########################\r\n # build: out path\r\n #########################\r\n if fpath_Out == nil\r\n\r\n # use => fpath_in string\r\n fpath_Out = fpath_in + \".METHODS\"\r\n \r\n end#if fpath_Out == nil\r\n\r\n #########################\r\n # build: methods list\r\n #########################\r\n # open file\r\n f_in = File.open(fpath_in, \"r\")\r\n \r\n #REF gets http://www.abbeyworkshop.com/howto/ruby/rb-readfile/index.html\r\n line = f_in.gets\r\n\r\n # pattern (if multiple, add 'm' after the right hand of '/' char)\r\n # what to detect => 1) method name, 2) parameters \r\n #REF multiple http://stackoverflow.com/questions/5239997/regex-how-to-match-multiple-lines answered Mar 9 '11 at 0:36\r\n pattern = /void (.+)(\\(.*\\)) {/\r\n\r\n # array for method strings \r\n methods = Array.new\r\n \r\n # read lines\r\n while(line)\r\n \r\n res = (line=~ pattern)\r\n \r\n match = line.match pattern\r\n \r\n # match?\r\n if match\r\n\r\n # push matched strings into the array \r\n methods << match[1] + \"\\t\" + match[2]\r\n# methods << match[1] + match[2]\r\n \r\n end\r\n \r\n # next line\r\n #REF gets http://www.abbeyworkshop.com/howto/ruby/rb-readfile/index.html\r\n line = f_in.gets\r\n \r\n end#while(line)\r\n \r\n #########################\r\n # close files: input file\r\n #########################\r\n f_in.close\r\n \r\n #########################\r\n # write: output\r\n #########################\r\n # open file\r\n f_Out = File.open(fpath_Out, \"w\")\r\n\r\n # sort: use '!' for destructive effect\r\n methods.sort!\r\n \r\n # counter\r\n counter = 0\r\n \r\n # write each method string (with a new-line char '\\n')\r\n methods.each_with_index do |m, i|\r\n \r\n f_Out.write(\"#{i + 1}.\\t#{m}\" + \"\\n\")\r\n# f_Out.write(m + \"\\n\")\r\n \r\n counter = counter + 1\r\n \r\n end\r\n \r\n #########################\r\n # close files: input file\r\n #########################\r\n f_Out.close\r\n \r\n #########################\r\n # return\r\n #########################\r\n return counter\r\n \r\nend", "def document_symbols(filename); end", "def document_symbols(filename); end", "def file_name\n file_name = (\"tmp/insert_externals.txt\")\n #file_name = (\"tmp/insert_internals.txt\")\n #file_name = (\"./tmp/insert_internals_hash.txt\")\n #file_name = (\"lib/anagrams/anagrams_table_data.txt\")\n #file_name = (\"tmp/insert_anagrams.txt\")\n #file_name = (\"tmp/insert_word_list.txt\")\n #file_name = (\"../../Documents/20110421-research_textualed.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hash-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hashlines-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hashlines_sorted_keys-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hashlines_sorted_values-015.txt\")\n end", "def get_file()\n puts(\"Please enter a file path: \")\n for arg in ARGV\n \tname = arg\n end\n print meta_data(name)\n name\nend", "def parse_file!\n File.open(@filepath, 'r') do |f|\n last_line = ''\n while this_line = f.gets\n coll = case this_line\n when /^\\s*def / : @methods\n when /^\\s*class / : @classes\n when /^\\s*module / : @modules\n when /^\\s*(attr_reader|attr_accessor|attr_writer) / : @attrs\n when /^\\s*[^a-z =]+\\s*=/ : @constants\n else nil\n end\n # add a true entry if comment precedes declaration or follows on same line\n coll << is_comment?(last_line) || has_comment?(this_line) if coll\n last_line = this_line\n end\n end\n end", "def list_known_names\n end", "def function_a\n#code\n\th = Hash.new\n\tFile.open('names.txt').each do |line|\n\t\ta = line.split\n\t\tif h[a[1].to_s] == nil\n\t\t\th[a[1].to_s] = a[0].chomp(',')\n\t\telsif h[a[1].to_s] != nil\n\t\t\tstr = h[a[1].to_s]\n\t\t\tstr = h[a[1].to_s] + \", \" + a[0].chomp(',')\n\t\t\th[a[1].to_s] = str\n\t\t\tnum = h[a[1].to_s].scan(/,/).count + 1\n\t\t\tputs a[1] + \" (\" + num.to_s + \"): [\" + h[a[1].to_s] + \"]\"\n\t\tend\n\tend\nend", "def output_functions\n @global_functions.until_empty! do |label, func|\n pos = func.body.respond_to?(:position) ? func.body.position : nil\n fname = pos ? pos.filename : nil\n #@e.include(fname) do\n output_function2(func, label, nil)\n #end\n end\n end", "def load_file(filename); end", "def load_file(filename); end", "def parse_def_file(filepath)\n\n $runParamsOpen = false; \n $runScopeOpen = false; \n $UpgradesOpen = false; \n \n $WildCardsInUse = false; \n \n rundefs = File.open(filepath, 'r') \n \n rundefs.each do | line |\n \n $defline = line\n $defline.strip! \n $defline.gsub!(/\\!.*$/, '')\n $defline.gsub!(/\\s*/, '')\n $defline.gsub!(/\\^/, '')\n \n if ( $defline !~ /^\\s*$/ ) \n\n case \n # Section star/end in the file \n when $defline.match(/RunParameters_START/i)\n $RunParamsOpen = true; \n \n when $defline.match(/RunParameters_END/i)\n $RunParamsOpen = false; \n \n when $defline.match(/RunScope_START/i)\n $RunScopeOpen = true; \n \n when $defline.match(/RunScope_END/i)\n $RunScopeOpen = false; \n \n when $defline.match(/Upgrades_START/i)\n $UpgradesOpen = true; \n \n when $defline.match(/Upgrades_END/i)\n $UpgradesOpen = false; \n \n else \n \n # definitions \n $token_values = Array.new\n $token_values = $defline.split(\"=\")\n \n\n \n if ( $RunParamsOpen && $token_values[0] =~ /archetype-dir/i ) \n # Where are our .h2k files located?\n \n $gArchetypeDir = $token_values[1] \n \n \n end\n \n \n if ( $RunParamsOpen && $token_values[0] =~ /run-mode/i ) \n # This does nothing only 'mesh' supported for now!!!\n $gRunDefMode = $token_values[1] \n \n if ( ! ( $gRunDefMode =~ /mesh/ || $gRunDefMode =~ /parametric/ ) ) then \n fatalerror (\" Run mode #{$gRunDefMode} is not supported!\") \n end \n \n end \n \n if ( $RunScopeOpen && $token_values[0] =~ /rulesets/i ) \n # Rulesets that can be applied. \n $gRulesets = $token_values[1].to_s.split(\",\")\n end \n \n if ( $RunScopeOpen && $token_values[0] =~ /archetypes/i ) \n \n # archetypes - \n $gArchetypes = $token_values[1].to_s.split(\",\")\n \n \n end \n \n if ( $RunScopeOpen && $token_values[0] =~ /locations/i ) \n \n # locations - \n $gLocations = $token_values[1].to_s.split(\",\")\n \n end \n \n if ( $UpgradesOpen ) \n \n option = $token_values[0]\n choices = $token_values[1].to_s.split(\",\")\n \n debug_out \" #{option} len = #{choices.grep(/\\*/).length} \\n\" \n \n if ( choices.grep(/\\*/).length > 0 ) then \n \n $WildCardsInUse = true \n \n end \n \n $gRunUpgrades[option] = choices\n\n $gOptionList.push option \n \n \n end \n \n\n end #Case \n \n end # if ( $defline !~ /^\\s*$/ ) \n \n end # rundefs.each do | line |\n\n \n # Check to see if run options contians wildcards \n \n \n if ( $WildCardsInUse ) then \n \n if ( ! $gOptionFile =~ /\\.json/i ) then \n fatalerror (\"Wildcard matching is only supported with .json option files\") \n end \n \n fOPTIONS = File.new($gOptionFile, \"r\") \n if fOPTIONS == nil then\n fatalerror(\" Could not read #{filename}.\\n\")\n end\n \n $OptionsContents = fOPTIONS.read\n fOPTIONS.close \n \n $JSONRawOptions = JSON.parse($OptionsContents)\n $OptionsContents = nil\n \n $gRunUpgrades.keys.each do |key| \n debug_out( \" Wildcard search for #{key} => \\n\" )\n \n \n \n \n $gRunUpgrades[key].clone.each do |choice| \n \n debug_out (\" ? #{choice} \\n\") \n \n if ( choice =~ /\\*/ ) then \n \n $pattern = choice.gsub(/\\*/, \".*\") \n \n debug_out \" Wildcard matching on #{key}=#{$pattern}\\n\" \n \n # Matching \n \n $SuperSet = $JSONRawOptions[key][\"options\"].keys\n \n $gRunUpgrades[key].delete(choice) \n\n $gRunUpgrades[key].concat $SuperSet.grep(/#{$pattern}/)\n \n \n end \n \n end \n \n \n end \n \n $JSONRawOptions = nil \n \n end \n\n \n \n \n # What if archetypes are defined using a wildcard? \n \n \n \n \n \n\nend", "def print_all(f)\t#function definition is used to read from file and prints the file.\r\n\tputs f.read\t\t\t\r\nend", "def defined_methods\n # TODO: check content type before scanning\n content.scan(/\\s*def\\s+([A-Za-z0-9_\\.]*)/).flatten\n end", "def get_filecode()\n \"__EMIT_#{ARGV[0].gsub(/[^\\w]/, \"_\").upcase}__\"\nend", "def functions\n\n end", "def parse_files(*files); end", "def print_functions() #method\n puts \"Functions directory:\"\n @functions.each do |key, food_function|\n puts \"-------------------start function-----------------------\"\n puts \"#{food_function.header}\"\n puts(\"|Header: #{food_function.header}, Parameters: #{food_function.parameters.map { |e| e.name }}, Return Type: #{food_function.return_type}, Quad Jump: #{food_function.quad_number}|\")\n puts \"--------------------end function------------------------\"\n end\n end", "def var_names(file)\n file2specific_module(file).var_names(file)\n end", "def data name\n File.read data_path(name)\nend", "def defs; end", "def defs; end", "def extract_method_name(line)\n line.strip.split('def ')[1]\n end", "def print_all(f) # defining a new method/function (print_all) that takes the paramter f as an argument\n puts f.read # reads file given as argument for print_all method\nend", "def definition_file_paths; end", "def list_names\n @lib.list_names\n end" ]
[ "0.66335344", "0.6316705", "0.62529147", "0.6136073", "0.6126373", "0.59391606", "0.59391606", "0.5909518", "0.5851262", "0.5851262", "0.5851262", "0.5851262", "0.5851262", "0.5851262", "0.5851262", "0.57839864", "0.5740372", "0.56873727", "0.5669565", "0.5652784", "0.5649223", "0.56362414", "0.56089514", "0.5607824", "0.55852574", "0.5582168", "0.55445325", "0.55386305", "0.55386305", "0.55365753", "0.5534023", "0.5534023", "0.5504113", "0.5485559", "0.548273", "0.54770654", "0.5456532", "0.5432577", "0.54164565", "0.5412696", "0.54117465", "0.5410107", "0.5407906", "0.5405847", "0.5390357", "0.53897", "0.5387296", "0.5387296", "0.53759545", "0.5362518", "0.53605014", "0.5350809", "0.5325558", "0.5325446", "0.5325446", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531661", "0.531419", "0.52951115", "0.52928954", "0.527168", "0.5268104", "0.5267429", "0.5261962", "0.5261962", "0.5254947", "0.5253897", "0.524401", "0.52139086", "0.5209319", "0.52077854", "0.5207033", "0.5207033", "0.5193454", "0.51638365", "0.51584893", "0.5153241", "0.5149859", "0.5128544", "0.51244056", "0.5115279", "0.5106729", "0.50994295", "0.50994295", "0.5098578", "0.50985646", "0.50968057", "0.50890875" ]
0.5598702
24
Read in the table JSON
def readTable(path) return JSON.parse(File.read(path).rstrip) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_table (filename)\n\t\t\tnew_table = File.open(filename)\n\t\t\t@file_table = JSON.load(new_table)\n\t\t\tnew_table.close\n\t\tend", "def table\n self.class.read_and_parse_file(@table_path)\n end", "def parse_json(json_)\n ::NTable.parse_json(json_)\n end", "def get_data\n raise \"This method should be overriden to return the JSON data for a concrete table\"\n end", "def read\n rows = to_a\n if @use_headers\n Table.new(rows)\n else\n rows\n end\n end", "def from_json_object(json_)\n Table.new(Structure.from_json_array(json_['axes'] || []), :load => json_['values'] || [])\n end", "def as_json(*args)\n super.as_json['table']\n end", "def parse_table; end", "def read_table(table_name)\r\n ODBC.connect('', '', '') do |db|\r\n rows = db.run(\"select * from #{table_name}\").each_hash\r\n\r\n rows.map do |row|\r\n row.transform_values!(&:strip)\r\n id = row['FFJITMN']\r\n desc = row['FFIIDE1'].sub(/^PRODX?/, '').strip\r\n cat = row['FFJPBHN']\r\n\r\n Item.new(id, desc, cat, nil)\r\n end\r\n end\r\nend", "def load_json(filename); end", "def read_table table\n table_offset = @archive_header.send \"#{table}_table_offset\"\n @io.seek @user_header.archive_header_offset + table_offset\n table_entries = @archive_header.send \"#{table}_table_entries\"\n data = @io.read table_entries * 16\n key = Hashing::hash_for :table, \"(#{table} table)\"\n data = Hashing::decrypt data, key\n klass = table == :hash ? HashTableEntry : BlockTableEntry\n (0...table_entries).map do |i|\n klass.read(data[i * 16, 16])\n end\n end", "def getTable() \n puts @table[0][\"name\"];\n end", "def parse json; return JSON.parse File.read json end", "def parse json; return JSON.parse File.read json end", "def get_all()\n return JSON.parse(File.read(@database_file))\n \n # error handling\n rescue Errno::ENOENT\n File.open(@database_file, 'w+')\n File.write(@database_file, [])\n retry\n end", "def get_table(table, env=nil)\n require 'net/http'\n http_config = get_remote_credentials(env)\n ret = false\n Net::HTTP.start(http_config['server_name'], http_config['server_port']) {|http|\n req = Net::HTTP::Get.new(\"/dumps/#{table}.txt\")\n req.basic_auth http_config['http_user'], http_config['http_pass']\n resp = http.request(req)\n ret = tab_to_array_of_hashes(resp.body) if resp.code == '200'\n }\n ret\n end", "def generate_tabular_report(filename, ostream)\n file = File.read(filename)\n data_hash = JSON.parse(file)\n rpt_data = transform(data_hash)\n rpt_data.keys.each do |name|\n ostream.puts\n ostream.puts name\n tbl = create_resources_table(rpt_data[name]['resources'])\n tbl.each do |r|\n ostream.puts r.join(\"\\t\")\n end\n end\nend", "def read_from_json\n JSON.parse File.new(@filepath).read\n end", "def get_table(table_name, options = {})\n headers = {\n Azure::Storage::Common::HeaderConstants::ACCEPT => Serialization.get_accept_string(:full_meta),\n }\n options[:request_location_mode] = Azure::Storage::Common::RequestLocationMode::PRIMARY_OR_SECONDARY\n response = call(:get, table_uri(table_name, new_query(options), options), nil, headers, options)\n Serialization.table_entries_from_json(response.body)\n rescue => e\n raise_with_response(e, response)\n end", "def index\n @data_tables = DataTable.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @data_tables.as_json(only: [:title, :username, :name, :email, :hometown]) }\n # end\n end", "def read_records(table)\n hashes = []\n each(table) {|hash| hashes << hash}\n hashes\n end", "def read\n file = File.read(@filename)\n JSON.parse(file)\n end", "def get_data\n json_file = Egd::Builder.new(File.read(@file)).to_json\n data = JSON.parse(json_file)\n end", "def get_data(class_name)\n return JSON.parse(File.read(@database_file))[class_name]\n \n # error handling\n rescue Errno::ENOENT\n File.open(@database_file, 'w+')\n File.write(@database_file, [])\n retry\n end", "def test_get_table_row_format\n remote_file_name = 'TestGetTableRowFormat.docx'\n\n upload_file File.join(local_test_folder, local_file), remote_data_folder + '/' + remote_file_name\n\n request = GetTableRowFormatRequest.new(name: remote_file_name, table_path: 'sections/0/tables/2', index: 0, folder: remote_data_folder)\n\n result = @words_api.get_table_row_format(request)\n assert_equal false, result.nil?\n end", "def read_input_file\n\t\tbegin \n\t\t\tfile = File.read('data.json')\n\t\t\tjson_info = JSON.parse(file)\n\t\t\t\n\t\t\t#getting cars and rentals information\n\t\t\t@cars = json_info[\"cars\"]\n\t\t\t@rentals = json_info[\"rentals\"]\n\t\trescue Exception => e \n\t\t\tputs \"Error trying to read the input file!\" \n\t\t\tputs e.message\n\t\tend\n\tend", "def data\r\n tables_ret = []\r\n tables.list.each do |name, table|\r\n tables_ret << table.data\r\n end\r\n \r\n return {\r\n \"tables\" => tables_ret\r\n }\r\n end", "def read_file_level_data\n cdjf = corresponding_data_json_file\n return {} if cdjf.nil?\n cdjf.read_data\n end", "def full_json\n @full_json ||=\n {\n name: table.name,\n limit: table.limit,\n big_blind: table.big_blind,\n small_blind: table.small_blind,\n max_players: table.max_players,\n available_players: table.available_players,\n pot: table.pot\n \n }\n end", "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend", "def main\n create_table\n set_timestamp_to_now\n json = fetch_data.to_json\n store json\nend", "def get_all_entries()\n jso = Hash.new()\n \n # Connect to database\n dbe = MIDB::API::Dbengine.new(@engine.config, @db)\n dblink = dbe.connect()\n rows = dbe.query(dblink, \"SELECT * FROM #{self.get_structure.values[0].split('/')[0]};\")\n if rows == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n # Iterate over all rows of this table\n rows.each do |row|\n jso[row[\"id\"]] = self.get_structure\n self.get_structure.each do |name, dbi|\n table = dbi.split(\"/\")[0]\n field = dbi.split(\"/\")[1]\n # Must-match relations (\"table2/field/table2-field->row-field\")\n if dbi.split(\"/\").length > 2\n match = dbi.split(\"/\")[2]\n matching_field = match.split(\"->\")[0]\n row_field = match.split(\"->\")[1]\n query = dbe.query(dblink, \"SELECT #{field} FROM #{table} WHERE #{matching_field}=#{row[row_field]};\")\n else\n query = dbe.query(dblink, \"SELECT #{field} from #{table} WHERE id=#{row['id']};\")\n end\n if query == false\n return MIDB::Interface::Server.json_error(400, \"Bad Request\")\n end\n jso[row[\"id\"]][name] = dbe.length(query) > 0 ? dbe.extract(query,field) : \"unknown\"\n jso[row[\"id\"]][name] = @hooks.format_field(name, jso[row[\"id\"]][name])\n end\n end\n @hooks.after_get_all_entries(dbe.length(rows))\n return jso\n end", "def tables(key = nil)\n key ||= properties.key1\n response = table_response(key, nil, \"Tables\")\n JSON.parse(response.body)['value'].map{ |t| Table.new(t) }\n end", "def rows\r\n assert_exists\r\n arr_rows = get_rows\r\n table_rows = Array.new(arr_rows.length)\r\n for i in 0..arr_rows.length - 1 do\r\n table_rows[i] = TableRow.new(@container, :jssh_name, arr_rows[i])\r\n end\r\n return table_rows\r\n end", "def read_jason(file_path)\r\n json_file = File.read(file_path)\r\n data_hash = JSON.parse(json_file)\r\n return data_hash\r\nend", "def read_json\n file = File.read('townhall.json')\n jason = JSON.parse(file)\n return jason\nend", "def get_json\n recipe_json = File.read('./recipes.json')\n @json_recipes = JSON.parse(recipe_json)\n end", "def list_tabledata dataset_id, table_id, max: nil, token: nil, start: nil\n # The list operation is considered idempotent\n execute backoff: true do\n json_txt = service.list_table_data \\\n @project, dataset_id, table_id,\n max_results: max,\n page_token: token,\n start_index: start,\n options: { skip_deserialization: true }\n JSON.parse json_txt, symbolize_names: true\n end\n end", "def tables\n @tables ||= {}.tap do |tables|\n parsed_data['tables'].map do |table|\n parsed_table_rows = parse_choices(table['rows'])\n tables[table['id']] = Table.new(table['name'], table['parameters'], parsed_table_rows)\n end\n end\n end", "def load_query_response\n load_file('sample_query_response.json')\nend", "def structure\n self.change_schema_to 'information_schema';\n @database_name, @table_name = request[:database_name], request[:name]\n @result = Hash.new success: true\n @result[:columns] = Column.where TABLE_SCHEMA: @database_name, TABLE_NAME: @table_name\n structure = Table.where(TABLE_SCHEMA: @database_name, TABLE_NAME: @table_name).first.attributes\n @result[:desc] = []\n structure.keys.length.times do |i|\n key = structure.keys[i]\n @result[:desc].push COLUMN_NAME: key, COLUMN_TYPE: structure[key]\n end\n \n @result[:type] = 'table'\n @result[:name] = @table_name\n \n render json: @result\n end", "def test_get_table_row_format_online\n request_document = File.open(File.join(local_test_folder, local_file))\n request = GetTableRowFormatOnlineRequest.new(document: request_document, table_path: 'sections/0/tables/2', index: 0)\n\n result = @words_api.get_table_row_format_online(request)\n assert_equal false, result.nil?\n end", "def read_data_object( filename )\n\n data_dir = self.config['data_dir'] || '_data'\n data_path = File.join(self.config['source'], data_dir)\n if File.symlink?(data_path)\n return \"Data directory '#{data_path}' cannot be a symlink\"\n end\n file = File.join(data_path, filename)\n\n return \"File #{file} could not be found\" if !File.exists?( file )\n \n result = nil\n Dir.chdir(data_path) do\n rows = []\n CSV.foreach(filename, headers: true, col_sep: ',') do |row|\n rows << row.to_hash\n end\n result = rows\n end\n puts \"## Error: No data in #{file}\" if result.nil?\n result = JSON.parse( result.to_json ) if result\n { 'data' => result,\n 'mtime' => File.mtime(file) }\n end", "def run\n super\n\n f = _get_entity_name\n\n # Read and split the file up\n begin\n json = JSON.parse (File.open(f,\"r\").read)\n rescue JSON::ParserError => e\n _log_error \"Unable to parse, failing...\"\n return\n end\n\n\n\n\n\n end", "def get_table(scaffold, **filters)\n get_url = \"#{@device_address}/admin/scaffolds/#{scaffold}/index.json?api_key=#{@device_api_key}\"\n json_body = JSON.parse(Excon.get(get_url).body)\n\n if filters.any?\n filters.each do |name, value|\n json_body.keep_if { |return_item| return_item[name.to_s] == value.to_s }\n end\n end\n\n json_body\n end", "def read\n return nil unless File.file?(\"./#{filename}\")\n JSON.parse(IO.read(filename))\n end", "def read_JSON_file # called a helper method (is helping you to use less code and dealing with something so that your other methods don't have to)\n @json_data = File.read('./lib/contacts.json')\n @contacts = JSON.parse(@json_data, {:symbolize_names => true})\n end", "def test_get_table_row\n remote_file_name = 'TestGetTableRow.docx'\n\n upload_file File.join(local_test_folder, local_file), remote_data_folder + '/' + remote_file_name\n\n request = GetTableRowRequest.new(name: remote_file_name, table_path: 'tables/1', index: 0, folder: remote_data_folder)\n\n result = @words_api.get_table_row(request)\n assert_equal false, result.nil?\n end", "def index\n \n get_table_name #method for table_names and model_names \n\n get_table_column_name # method for table_name, column_names and model_name \n\n get_table_data # method for table data\n\n @model_data = []\n \n @model_data = @model_name.order(sort_column + \" \" + sort_direction).page(params[:page]).per(10)\n\n respond_to do |format|\n\t format.html\n\t format.json\n \tend\n\n end", "def table_response(key, query = nil, *args)\n url = File.join(properties.primary_endpoints.table, *args)\n\n headers = build_headers(url, key, 'table')\n headers['Accept'] = 'application/json;odata=fullmetadata'\n\n # Must happen after headers are built\n unless query.nil? || query.empty?\n url << \"?#{query}\"\n end\n\n ArmrestService.send(\n :rest_get,\n :url => url,\n :headers => headers,\n :proxy => proxy,\n :ssl_version => ssl_version,\n :ssl_verify => ssl_verify,\n )\n end", "def read_tasks\n JSON.parse(File.read(\"tasks.json\"))\nend", "def read(params = {})\n {}.tap do |res|\n records = get_records(params)\n res[\"children\"] = records.map{|r| node_to_hash(r, final_columns(with_meta: true)).netzke_literalize_keys}\n res[\"total\"] = count_records(params) if config[:enable_pagination]\n end\n end", "def index\n @jsons = Json.all\n\n\n end", "def prepare_json\n\t\tjson_header\n\t\tjson_assemble\n\t\t#order_by_line_id(@file)\n\t\t#json_sections\n\t\t#json_order_line_by_section\n\n\tend", "def parse_table(doc)\n rows = doc.css('table#listUsersTable tbody tr')\n data = rows.map do |row|\n id, name, details = row.search('td')\n url = details.search('a').first['href']\n {id: id.content, name: name.content, registry_url: BASE_URL + url}\n end\nend", "def parse_table(doc)\n rows = doc.css('table#listUsersTable tbody tr')\n data = rows.map do |row|\n id, name, details = row.search('td')\n url = details.search('a').first['href']\n {id: id.content, name: name.content, registry_url: BASE_URL + url}\n end\nend", "def table_data\n [{\n cells: @story_bundles.map do |bundle|\n if bundle.valid?\n cell_data_for_valid_bundle(bundle)\n else\n cell_data_for_invalid_bundle(bundle)\n end\n end\n }]\n end", "def readJson(dataFilePath)\n dataFile = File.new(dataFilePath, \"r\");\n data = JSON.load(dataFile);\n dataFile.close();\n data;\nend", "def render_json_index(table)\n render json: serializer(table).new(model(table).all)\n end", "def parse_json(csv_file)\n data_frame = Daru::DataFrame.from_csv(csv_file)\n data_frame\nend", "def test_it_can_get_list_of_tables\n VCR.insert_cassette 'tables'\n tables = @api.tables('writer1')\n\n assert_kind_of Array, tables\n assert_equal 2, tables.size\n\n assert_kind_of Hash, tables.first\n assert_kind_of Hash, tables.last\n\n assert_equal \"out.c-main.categories\", tables.first[\"id\"]\n assert_equal \"out.c-main.products\", tables.last[\"id\"]\n assert_equal \"Categories\", tables.first[\"name\"]\n assert_equal \"Products\", tables.last[\"name\"]\n end", "def _get_dyn_table(console, address, payload = nil)\n if payload\n response = AJAX.post(console, address, payload)\n else\n response = AJAX.get(console, address)\n end\n response = REXML::Document.new(response)\n\n headers = _dyn_headers(response)\n rows = _dyn_rows(response)\n rows.map { |row| Hash[headers.zip(row)] }\n end", "def parse_cards_json\n filepath = File.join(Rails.root, 'db', 'json', 'AllSets.enUS.json')\n file_contents = File.open(filepath).read\n JSON.parse(file_contents)\nend", "def read_unicorns\n JSON.parse(File.read(\"unicorns.json\"))\nend", "def sql_data\n sql_data = File.read('sql.json')\n parsed_data = JSON.parse(sql_data)\n parsed_data['SQL']\n i = 0\n while i< parsed_data['SQL'].length\n curriculum = Curriculum.new\n curriculum.url = parsed_data['SQL'][i]['url']\n curriculum.description = parsed_data['SQL'][i]['description']\n curriculum.title = parsed_data['SQL'][i]['title']\n curriculum.curriculum_type = \"SQL\"\n curriculum.save\n i+=1\n end\n end", "def read_articles\n JSON.parse(File.read(\"articles.json\"))\nend", "def table; end", "def table; end", "def table; end", "def table; end", "def load(io)\r\n data = parse(io.read)\r\n \r\n if rows\r\n data = data[rows]\r\n end\r\n \r\n if columns\r\n data.collect! do |cols|\r\n cols[columns]\r\n end\r\n end\r\n \r\n data\r\n end", "def data\n @data ||= MultiJson.load(File.read(index_path))\n end", "def json_to_ruby\n json = File.read('./database/townhalls.json')\n obj = JSON.parse(json)\n return obj\n end", "def read_json_file(path)\n JSON.parse(File.open(path){ |f| f.read })\nend", "def get_table_with_http_info(name, table_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PdfApi.get_table ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling PdfApi.get_table\"\n end\n # verify the required parameter 'table_id' is set\n if @api_client.config.client_side_validation && table_id.nil?\n fail ArgumentError, \"Missing the required parameter 'table_id' when calling PdfApi.get_table\"\n end\n # resource path\n local_var_path = \"/pdf/{name}/tables/{tableId}\".sub('{' + 'name' + '}', name.to_s).sub('{' + 'tableId' + '}', table_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n # Fix header in file\n post_body = nil\n\n # http body (model)\n # Fix header in file\n # post_body = nil\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TableRecognizedResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PdfApi#get_table\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def table\n @table ||= synchronize { Loader.load_all }\n end", "def get_schema\n schema = CLIENT_TABLES.map {|t| {:name => t.table_name, :columns => table_schema(t)} }\n \n# respond_to do |format|\n# format.js { render({:content_type => :js, :text => schema.to_json}) }\n# end\n \n render_json schema.to_json\n end", "def table\n Airmodel.client.table base_config[:base_id], base_config[:table_name]\n end", "def index\n @jsons = Json.all\n end", "def get_reading\n\t\turi = URI.parse('http://localhost:5000/thermometers.json')\n\t\tthermo_response = Net::HTTP.get_response(uri)\n\t\tcheck = thermo_response.body\n\t\tj = JSON.parse(check)\n\tend", "def get_table_list()\n resp = @dynamo_db.list_tables()\n puts \"Table list : \" + resp.table_names.to_s\nend", "def parse\n file = File.read(@file)\n @data = JSON.parse(file)\n end", "def open_data(file)\n @data = JSON.parse(IO.readlines(file).join)\n end", "def parse_json(json)\n return nil if json.nil?\n h = JSON.parse(json)\n data = h['results']['bindings']\n {\n :headings => h['head']['vars'], \n :rows => data.map {|i| i.to_a.map {|x| x[1]['value']}}\n }\nend", "def read(path)\n new(CSV.read(path, **table_opts), path)\n end", "def test_get_mneme_json_data_todolms\n file_name = \"studenta\"\n file_name = IO.read(\"#{@@testFileDir}/todolms/mneme/#{file_name}.json\")\n refute_nil file_name, \"find test file\"\n jsonA = JSON.parse(file_name)\n refute_nil jsonA, \"check that file contents are understood as json\"\n end", "def index\n file = File.read \"db/extract.json\"\n data = JSON.parse(file)\n @places = PLACES\n end", "def table_info(table, key = nil)\n key ||= properties.key1\n response = table_response(key, nil, \"Tables('#{table}')\")\n Table.new(response.body)\n end", "def table_open(opts)\n @table = []\n @table_multirow = {}\n @table_multirow_next = {}\n return \"\"\n end", "def parse(json_file)\r\n CoreLogger.instance.logger.info(\"JsonTools - parse\") { \"Parsing du fichier '#{json_file}'\" }\r\n cars_array = nil\r\n rentals_array = nil\r\n begin\r\n # Check file\r\n check_json_file_path(json_file)\r\n json_data = JSON.parse(File.read(json_file))\r\n # Binding json data to obj\r\n cars_array = json_data_cars_to_array json_data\r\n rentals_array = json_data_rentals_to_array json_data\r\n rescue JSON::ParserError => j\r\n CoreLogger.instance.logger.info(\"JsonTools - parse\") { \"Parsing du fichier '#{json_file}'\" }\r\n raise JsonLoaderTechnicalException.new(\"JsonLoader - parse : Structural problem in json file.\\nJSON::ParserError => #{j.message}\")\r\n rescue JsonLoaderTechnicalException => t\r\n raise t\r\n rescue JsonLoaderFonctionalException => f\r\n raise f\r\n end\r\n return cars_array, rentals_array\r\n end", "def table table_id\n ensure_connection!\n resp = connection.get_table dataset_id, table_id\n if resp.success?\n Table.from_gapi resp.data, connection\n else\n nil\n end\n end", "def getTable url\n page = Nokogiri::HTML(open(url), nil, 'UTF-8')\n tableTr = page.xpath('//*[@id=\"page-form\"]/div[2]/div[2]/table//tr')\n return tableTr\nend", "def contents\n tbl = super\n # sane default:\n tbl ||= Dict.new()\n end", "def get_table(name, table_id, opts = {})\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_table_with_http_info(name, table_id, opts)\n rescue ApiError => error\n if error.code == 401\n @api_client.request_token_if_needed\n data, _status_code, _headers = get_table_with_http_info(name, table_id, opts)\n else\n raise\n end\n return data\n end", "def get_all_tables\n\t\ttc = new_sub(@discovery['tables'])\n\t\ttc.poll[:messages].map {|x| pp x; JSON.parse(x.content) rescue nil}.compact\n\tend", "def get_all_data(table)\n return $db.execute('SELECT * FROM ' + table);\n end", "def get_model_table(part)\n rows = @parser.find(part).find_children('tr').list_results\n table = []\n rows.each do |row|\n table.push(\n get_model_row(@parser.find(row).find_children('td,th').list_results)\n )\n end\n get_valid_model_table(table)\n end", "def getDBData(urlInput)\n url = URI.parse(urlInput)\n server = Couch::Server.new(url.host, url.port)\n res = server.GET(urlInput)\n puts \"PARSING JSON FILE--------------\"\n json = JSON.parse(res.body)\n return json\n end", "def get_all_tables\n\t\ttc = new_sub(@discovery['tables']['url'], @discovery['tables']['capability'])\n\t\ttc.listen.map {|x| JSON.parse(x) rescue nil}.compact\n\tend", "def browse_json\r\n file = File.read('./db/townhalls.json')\r\n datas = JSON.parse(file)\r\n\r\n # elle fait une boucle dnas le fichier json pour sortir deux eléments, les mails et les names\r\n (0...datas.length).each do |i|\r\n send_mails(datas[i]['mail'], datas[i]['name'])\r\n puts datas[i]['name']\r\n puts datas[i]['mail']\r\n end\r\n end" ]
[ "0.7256125", "0.69474566", "0.6754364", "0.66707605", "0.64308697", "0.6232659", "0.60649", "0.60297436", "0.602133", "0.5964239", "0.5830802", "0.5751797", "0.56991273", "0.56991273", "0.5664855", "0.5638613", "0.56268764", "0.56209123", "0.5603976", "0.55999094", "0.5592211", "0.5589784", "0.5589133", "0.5539448", "0.5536832", "0.55264086", "0.5523626", "0.55167425", "0.5509248", "0.54736495", "0.5457388", "0.545394", "0.5449393", "0.5444066", "0.5424401", "0.5405625", "0.5402999", "0.5394791", "0.53709084", "0.5368722", "0.5357082", "0.53385574", "0.53256506", "0.5310357", "0.5307501", "0.53071487", "0.5302386", "0.5296194", "0.52844614", "0.528349", "0.5273925", "0.52592987", "0.5255228", "0.5252736", "0.5242654", "0.5242654", "0.5222533", "0.5217624", "0.5216596", "0.52091074", "0.5206073", "0.5204155", "0.5197284", "0.51905483", "0.51893353", "0.5183933", "0.51686734", "0.51686734", "0.51686734", "0.51686734", "0.5168149", "0.51668304", "0.5166659", "0.5158835", "0.51548904", "0.5153838", "0.5153598", "0.51524496", "0.51504266", "0.5147325", "0.5147196", "0.5145808", "0.5138273", "0.5138165", "0.51357436", "0.5135698", "0.5119263", "0.5114942", "0.5114219", "0.5103424", "0.5103255", "0.5103197", "0.5101167", "0.5087153", "0.5083915", "0.5083853", "0.50831586", "0.5077557", "0.5068794", "0.50671446" ]
0.80408955
0
Initialise the log entry
def initLog(data) n = data[:names].join("; ") l = data[:data].length p = (l === 1) ? "y" : "ies" return %Q_- NAME: #{n}\n #{l} matching entr#{p}\n_ end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize()\n @log = {}\n end", "def initialize(*args)\n @init_args = args\n set_log(*args)\n end", "def initialize\n\t\t@@logger = OMLogger.getLogger(DataHelper.name)\n\tend", "def initialize\n Logging.setup(Logger::INFO)\n end", "def init\n Logging.logger.root.level = :debug\n Logging.logger.root.add_appenders(\n Logging.appenders.stdout(\n :backtrace => false,\n :level => @config[:verbose] ? :debug : :info,\n :layout => Logging.layouts.pattern(:pattern => STDOUT_PATTERN)\n ),\n Logging.appenders.rolling_file(\n @log_file,\n :backtrace => true,\n :level => :debug,\n :layout => Logging.layouts.pattern(:pattern => LOG_FILE_PATTERN)\n )\n )\n Logging.mdc['client'] = 'server'\n end", "def initialize\n @log = Logging::Logger[self]\n end", "def initialize logger = Nacreon.log\n\t\t\tself.log = logger\n\t\tend", "def initialize device = STDOUT, level = INFO\n self.level = level\n @logformat = '%d{%Y-%m-%d %H:%M:%S}%t%L%t%m %s %e'\n @placeholder = {\n 'n' => \"\\n\",\n 'p' => $$,\n 't' => \"\\t\",\n 'x' => File.basename($0),\n 'X' => File.expand_path($0)\n }\n\n @filename = nil\n if device.kind_of? IO then\n raise \"log destination already closed #{ device }\" if device.closed?\n @device = device\n @fileformat = nil\n else\n @device = nil\n @fileformat = device.to_s\n reopen\n end\n\n @sign = @mark = false\n end", "def initialize(log)\n @log = log\n end", "def initialize\n log_path = @@log[:path] + 'one2influx.log'\n begin\n $LOG = Logger.new(log_path, 'daily', 30)\n rescue Exception => e\n raise \"Unable to create log file. #{e.message}\"\n end\n $LOG.level = @@log[:level]\n\n convert_to_sec\n prepare_storage_ids\n prepare_vm_config\n end", "def post_init\n # puts 'Syslogger initialized'\n end", "def initialize_audit_log\n # only save logs for POST,PUT,PATCH and DELETE methods\n # creates\n if (request.post? || request.patch? || request.put? || request.delete? )\n @audit_log = AuditLog.new\n @audit_log.ip = request.remote_ip\n @audit_log.user_name = current_user.full_name\n end\n\n end", "def init(log_device)\n @log_device = initialize_log_device(log_device)\n end", "def new\n @log_entry = LogEntry.new\n end", "def initialize_log(log)\n close if @log # be sure that we don't leave open files laying around.\n\n if log.respond_to?(:write)\n @log = log\n elsif File.exist?(log)\n @log = open(log, (File::WRONLY | File::APPEND))\n @log.sync = true\n else\n FileUtils.mkdir_p(File.dirname(log)) unless File.directory?(File.dirname(log))\n @log = open(log, (File::WRONLY | File::APPEND | File::CREAT))\n @log.sync = true\n @log.write(\"#{Time.now.httpdate} #{delimiter} info #{delimiter} Logfile created\\n\")\n end\n end", "def prepare_log\n ProcessLogger.construct('log/logfile.log')\n end", "def initialize( logger, level, data, trace )\n f = l = m = ''\n\n if trace\n stack = Kernel.caller[::Logging::LogEvent.caller_index]\n return if stack.nil?\n\n match = CALLER_RGXP.match(stack)\n f = match[1]\n l = Integer(match[2])\n m = match[3] unless match[3].nil?\n end\n\n super(logger, level, data, Time.now, f, l, m)\n end", "def initialize\n @logger = Logger.new('cf_flattener.log')\n end", "def initialize(params={})\n @logger = params[:logger] || Logger.new(STDOUT)\n @entries = {}\n @entries_mutex = Mutex.new\n end", "def initialize\n @log = Logging::Logger[self]\n @options = self.default_options\n end", "def setup_log\r\n logfile = File.open(\"/home/englandk/rails_apps/reminders/log/auto_enquiry.log\", 'a')\r\n \r\n @log = AuditLogger.new(logfile)\r\n @log.level = Logger::INFO\r\n @log.debug \"Started auto response email run\"\r\n end", "def initialize(log, time_format=\"%Y-%m-%d %H:%M:%S\")\n @log = log\n @time_format = time_format\n end", "def init\n Config.load_yaml\n Log.init\n reset\n end", "def initialize_log\n if @configuration[:debug].nil?\n @logger = Yell.new format: Yell::ExtendedFormat do |l|\n l.adapter :datefile, 'send.log'\n l.adapter STDOUT\n end\n else\n @logger = Yell.new format: Yell::ExtendedFormat do |l|\n l.adapter :datefile, 'test.log'\n l.adapter STDOUT\n end\n end\n end", "def initialize\n @logger = Logging::Logger[self]\n end", "def initialize\n @logProvider = DefaultLogger.new\n end", "def initialize prev=nil\n @prev_logger = prev\n super(nil)\n end", "def set_entry_log\n @entry_log = EntryLog.find(params[:id])\n end", "def initialize( )\n ::Logging.init unless ::Logging.initialized?\n\n @name = 'root'\n @appenders = []\n @additive = false\n @caller_tracing = false\n @level = 0\n ::Logging::Logger.define_log_methods(self)\n end", "def init \n\t$LOG = Logger.new($STDOUT,:pattern => config.log_pattern)\n# repository = ARGV.shift\n# transaction = ARGV.shift\n# raise 'Bad Arguments' if !transaction or !repository\n @projects = create_projects # parse the projects configuration\n# @commit = Commit.new(repository,transaction)\n @closed_status=config.closed_status\n\nend", "def init(obj)\n @@logs[@logname].debug \"Creating '#{obj.to_s}'.\" # Use inside def initialize, to get object id\n end", "def initialize\n @logger = BikeIn::Common::CustomLogger.new self.to_s\n end", "def initialize\n @logger = RubyConfigr::AppLogger.get_logger();\n end", "def initialize(filename)\r\n @log = {}\r\n @size = 0\r\n\r\n @logFile = File.new(filename) # Open the log file\r\n\r\n # Read in the Log file\r\n @logFile.each do |line|\r\n values = line.split(',') # Split the line at the commas\r\n dateParts = values[0].split('/') # Split the date field up at the slashes\r\n\r\n date = Date.parse(\"#{dateParts[2]}-#{dateParts[0]}-#{dateParts[1]}\") # Parse the date string into a valid Date object\r\n\r\n add_logItem(values[1].chomp!, date)\r\n end\r\n end", "def initialize(env)\n # get log level (default to \"warn\" if unspecified)\n log_level = (env.get('LOG_LEVEL', DEFAULT_LEVEL)).upcase\n\n # create logger from log path (default to STDERR)\n super(env.get('LOG_PATH', STDERR))\n\n # set log level (default to WARN)\n self.level = ::Logger.const_get(log_level)\n\n # log level\n info('Env::Log#initialize') do\n 'level = %p' % [log_level]\n end\n end", "def initialize\n @logger = Logger.new(STDOUT)\n super(@logger)\n end", "def make_log_entry\n le = LogEntry.new(:description => \"Desc ##{sn}\")\n le end", "def initialize(*args)\n class <<self\n self\n end.class_eval do \n # define attrr_accessors\n self.log_attr['git-log-attr'].keys.each do |attr_varname|\n attr_accessor attr_varname\n end\n end\n # set values\n # self.class = Metalog\n self.class.log_attr['git-log-attr'].keys.each_with_index {|attribute, index| self.send(\"#{attribute}=\", args[index])}\n end", "def initialize(log, cache)\n @log, @cache = log, cache\n end", "def initialize\n @format = configatron.log_format #'%h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"'\n @counter = 0\n @start = Time.now\n @h_ip_hits = Hash.new(0) #ip => hits\n @h_status_hits = Hash.new(0) #status => hits\n @parser = ApacheLogRegex.new(@format)\n @oh = ActiveSupport::OrderedHash.new\n# @oh_status = ActiveSupport::OrderedHash.new\n@h = {}\n end", "def initialize\n @logger = ::Logger.new(STDOUT)\n self.level = :info\n end", "def init_logs\n begin\n if !@cloud.log_directory.nil?\n node_log_file = @cloud.log_directory + \"/#{@name.to_s}.log\"\n if !File.exists?(node_log_file)\n File.new(node_log_file, \"a+\")\n @log_file = node_log_file\n @logger.info \"Created #{node_log_file}\"\n end\n outputter = Log4r::FileOutputter.new(\"#{@name.to_s}-file\", :formatter => FileFormatter.new, :filename => node_log_file, :truncate => false)\n @logger.add(outputter)\n end\n rescue RuntimeError => rerr\n if !rerr.message.eql?(\"Maestro not configured correctly. Either RAILS_ROOT, Rails.root, or ENV['MAESTRO_DIR'] must be defined\")\n @logger.error \"Unexpected Error\"\n @logger.error rerr\n end\n rescue SystemCallError => syserr\n @logger.error \"Error creating Node log file\"\n @logger.error syserr\n rescue StandardError => serr\n @logger.error \"Unexpected Error\"\n @logger.error serr\n end\n end", "def initialize\n #create the log directory\n @trf = Transformer.factory getTransType\n if $CNF['facility_name'].blank?\n @archive_location = \"Archive/#{Time.now.strftime(\"%Y%m%d\")}/Claim/#{$CNF['client_name'].split(' ').join}\"\n @failed_location = \"failed_claim_files/#{Time.now.strftime(\"%Y%m%d\")}/Claim/#{$CNF['client_name'].split(' ').join}\"\n else\n @archive_location = \"Archive/#{Time.now.strftime(\"%Y%m%d\")}/Claim/#{$CNF['facility_name'].split(' ').join}\"\n @failed_location = \"failed_claim_files/#{Time.now.strftime(\"%Y%m%d\")}/Claim/#{$CNF['facility_name'].split(' ').join}\"\n end\n \n system \"mkdir -p #{@archive_location}\"\n system \"mkdir -p #{@failed_location}\"\n end", "def initialize(log_file, config)\n @log_file = log_file\n @config = config\n end", "def create_log(param); end", "def init(*opts)\n if opts.length == 0\n @logger = Logger.new(STDOUT)\n else\n @logger = Logger.new(*opts)\n end\n @logger.formatter = Ohai::Log::Formatter.new()\n level(Ohai::Config.log_level)\n end", "def initLogger()\n\tconfig = FileUtil.loadjson(File.dirname(__FILE__) + '/utilcfg.json')\n\tif config.key?('log.path')\n\t\tlpath = config['log.path']\n\t\tunless File.file?(lpath)\n\t\t\tdpath = lpath.gsub(/[^\\/]+$/,'')\n\t\t\tDir.mkdir(dpath) unless Dir.exist?(dpath)\n\t\tend\n\t\tif config.key?('log.interval')\n\t\t\t$logger = Logger.new(lpath, config['log.interval'])\n\t\telse\n\t\t\t$logger = Logger.new(lpath)\n\t\tend\n\tend\n\tLogUtil.setformatter\n\tLogUtil.setloglevel(config['log.level'])\nend", "def initialize options = {}\n @flog = Flog.new options\n end", "def initialize(id, c)\n\t\t\t@id = id\n\t\t\t#super(id)\n\t\t\t@config = c\n\t\t\t@file_log = config.file_log\n\t\tend", "def init_logging\n app_name = ENV[\"APP_NAME\"] || \"calcentral\"\n format = PatternFormatter.new(:pattern => \"[%d] [%l] [CalCentral] %m\")\n\n Rails.logger = Log4r::Logger.new(app_name)\n Rails.logger.level = DEBUG\n Rails.logger.outputters = init_file_loggers(app_name, format)\n\n stdout = Outputter.stdout #controlled by Settings.logger.level\n stdout.formatter = format\n # level has to be set in the logger initializer, after Settings const is initialized.\n # see initializers/logging.rb\n Rails.logger.outputters << stdout\n end", "def initialize(*)\n @l = SingLogger.instance\n end", "def initialize(resource = nil)\n @resource = resource\n @logger = @resource&.create_log # This is an ImportLog.\n end", "def init_rss_log(orphan: false)\n return rss_log if rss_log\n\n rss_log = RssLog.new\n rss_log.created_at = created_at unless new_record?\n rss_log.send(\"#{type_tag}_id=\", id) if id && !orphan\n rss_log.save\n attach_rss_log_first_step(rss_log) unless orphan\n rss_log\n end", "def init(identity = nil, path = nil)\n unless @initialized\n @initialized = true\n @level_frozen = false\n logger = nil\n\n if @log_to_file_only || RightLinkConfig[:platform].windows?\n if path\n file = File.join(path, \"nanite.#{identity}.log\")\n else\n file = STDOUT\n end\n logger = Logger.new(file)\n logger.formatter = Formatter.new\n else\n logger = SyslogLogger.new(@program_name || identity || 'RightLink')\n end\n\n @logger = Multiplexer.new(logger)\n self.level = :info\n end\n @logger\n end", "def initialize(mode = :normal)\n self.mode = mode\n time = Time.now.strftime(LOG_TIMESTAMP_FORMAT)\n @log_file = \"#{Dir.pwd}/logs/#{time}.log\"\n @log_modes = [:warn, :error]\n end", "def initialize(activity_log = nil, e_sign_document = nil)\n return unless activity_log && e_sign_document\n\n @current_user = activity_log.current_user\n esc = activity_log.extra_log_type_config.e_sign\n @specified_fields = esc[:fields]\n @document_title = esc[:title]\n @document_intro = esc[:intro]\n @prepared_doc = activity_log.e_signed_document\n @e_sign_document = e_sign_document\n end", "def log \n @log #||= Log.create\n end", "def setup\n self.logger.reopen(File.open(File.join(Lokii::Config.root, Lokii::Config.log), \"a\")) if daemon? && self.logger\n self.logger ||= ::Logger.new(File.join(Lokii::Config.root, Lokii::Config.log))\n end", "def initialize(logger = T.unsafe(nil)); end", "def init_logger\n l = Logger.new(STDOUT)\n l.level = Logger::INFO\n Log.logger = l\nend", "def log_startup\n log_environment\n log_dispatcher\n log_app_name\n end", "def initialize(project_root_path)\n @project_root_path = project_root_path\n\n @log ||= Logger.new(\"#{local_log_dir}/#{WATCHER_LOG_FILE}\")\n @log.level = Logger::DEBUG\n\tend", "def new\n @log = Log.new\n end", "def log=(log); end", "def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end", "def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end", "def initialize_logger()\n case logger_type\n when :local\n log_path = File.join(RAILS_ROOT, 'log', \"#{config_basename}.log\")\n system(\"cat /dev/null > #{log_path}\")\n ActiveSupport::BufferedLogger.new(log_path)\n when :remote\n RemoteLogger.new(config_basename, File.join(RAILS_ROOT, 'log'), proc_id)\n when :stderr\n logger = ActiveSupport::BufferedLogger.new($stderr)\n logger.auto_flushing = true\n logger\n else\n raise ArgumentError, \"logger_type must be :local,:remote or :stderr\"\n end\n end", "def initialize(args={})\n @log = args[:log] # will contain an instance of some type of Logger object (Ruby, Log4R, etc.)\n log.debug \"#{self.class} initialize called..\"\n @errors = [] # an array of error messages\n @exercise = nil # will contain the exercise created upon import\n end", "def initialize\n self.logger = Logger.new(STDOUT)\n reset!\n end", "def initialize\r\n @day = \r\n @interval = 1\r\n \r\n @positions = []\r\n\t@width = 24\r\n\t@height = 20\r\n\t@sun_location = 1\r\n\t@snow_count = 0\r\n\t@rain_count = 0\r\n\t@show_weather = true\r\n\t@water_groups = [1]\r\n\r\n\t@logger = Log.new\r\n\tif @log == true\r\n\t \r\n\t @logger.write \"started\"\r\n\tend\r\n end", "def initialize(logdev, shift_age=0, shift_size=1048576)\n @log = (logdev.kind_of?(::Logger) ? logdev : ::Logger.new(logdev, shift_age, shift_size))\n @name = nil\n end", "def initialize(key, log: Loog::NULL)\n raise 'Key can\\'t be nil' if key.nil?\n @key = key\n raise 'Log can\\'t be nil' if log.nil?\n @log = log\n end", "def set_log_entry\n @log = Log.find(params[:id])\n end", "def initialize(log_dir = VidazingLogger::LOG_DIR, name:)\n @name = name\n @log_dir = log_dir\n\n create_log_dir\n end", "def initialize(datacenter_context)\n super(datacenter_context)\n @leader = @datacenter.name\n @logger = Logger.new($stdout)\n @logger.formatter = proc do |severity, datetime, progname, msg|\n \"[#{datetime}] #{@datacenter.name}(Leader): #{msg}\\n\\n\"\n end\n end", "def init_log_files\n LOG_FILES.each do |filename|\n log_variable = \"@#{filename}_log\"\n log_file = ActiveSupport::Logger.new(\"#{@donor_category_path}/#{filename}.log\")\n\n instance_variable_set(log_variable, log_file) unless instance_variable_defined?(log_variable)\n self.class.send(:attr_accessor, \"#{filename}_log\")\n end\n end", "def initialize repo, type\n @repo, @process, @type = repo, 'activity', type\n @log = RepoLog.create_log @repo, @process, @type\n end", "def initialize(_logDir, _basename)\n @logDir = _logDir ;\n setBasename(_basename) ;\n end", "def initialize(logdev, shift_age=0, shift_size=0)\n @default_shift_age = shift_age\n @default_shift_size = shift_size\n target = ::Logger.new(logdev, shift_age, shift_size)\n target.formatter = DEFAULT_FORMATTER\n @targets = [target]\n end", "def initialize(logdevs = {}, progname = nil, shift_age = 0, shift_size = 1_048_576)\n super(nil, shift_age, shift_size)\n @progname = progname\n @shift_age = shift_age\n @shift_size = shift_size\n @lowest_level = DEFAULT_LEVEL\n configure_logs(logdevs)\n end", "def initialize(logdev)\n @progname = nil\n @level = DEBUG\n @default_formatter = Formatter.new\n @formatter = nil\n @logdev = nil\n if logdev\n @logdev = LogDevice.new(logdev)\n end\n end", "def init_logger(settings)\n settings[:VERSION] = `rake runerb:get_version`.chomp.gsub!('\"', '')\n FileUtils.mkdir_p(\"#{FileUtils.pwd}/assets/log\")\n settings[:LOG_FILE_PATH] = \"#{FileUtils.pwd}/assets/log/rune_rb-#{Time.now.strftime('%Y-%m-%d').chomp}.log\".freeze\n settings[:LOG_FILE] = Logger.new(settings[:LOG_FILE_PATH], progname: \"rune.rb-#{settings[:VERSION]}\")\n settings[:LOG] = Logger.new(STDOUT)\n settings[:COLOR] = Pastel.new\n settings[:LOG].formatter = proc do |sev, date, _prog, msg|\n \"#{settings[:COLOR].green.bold(\"[#{date.strftime('%H:%M')}]\")}|#{settings[:COLOR].blue(\"[#{sev}]\")} : #{msg}\\n\"\n end\n end", "def initialize(pointer)\n super(pointer)\n debugCB = Proc.new do |cookie, msg, msgLen|\n printf(\"lognorm: %s\\n\", msg)\n end\n setDebugCB(debugCB)\n end", "def log=(_arg0); end", "def log=(_arg0); end", "def log=(_arg0); end", "def initialize\n @username = nil\n @id = 0\n @file = File.open('execution.log', 'w+')\n @file.truncate(0)\n @file.write(\"File created: #{Time.now}\\n\")\n\n end", "def initialize(file_path = nil)\n _init(file_path)\n @log.info('Logger initialization complete.')\n end", "def create_log_entry\n Rails.logger.debug(\"@@@ create_log_entry: task = #{@task.inspect} event = #{@event.inspect}\")\n params = Hash.new\n params[:user_id] = current_user.id\n params[:role_id] = current_user.role.id\n params[:ot_id] = @task.ot.id\n params[:task_id] = @task.id\n params[:description] = \"Transicion de #{@task.current_state} a #{@task.current_state.events[@event.to_sym].transitions_to}\"\n log_entry = Audit.new(params)\n log_entry.save\n end", "def at_init\n\n\t\tend", "def set_log_entry\n @log_entry = LogEntry.includes(:user, :holding).where(:id => params[:id], :admin_id => @current_user.id).first\n end", "def initialize(logger)\n @log = logger\n end", "def initialize_log(log_target = STDOUT)\n oldlogger ||= nil\n @logger = Logger.new(log_target)\n @logger.level = Logger::INFO\n oldlogger.close if oldlogger && !$TESTING # don't want to close testing's STDOUT logging\n @logger\n end", "def initialize( logger, level, data, trace )\n f = l = m = ''\n\n if trace\n stack = Kernel.caller[CALLER_INDEX]\n return if stack.nil?\n\n match = CALLER_RGXP.match(stack)\n f = match[1]\n l = Integer(match[2])\n m = match[3] unless match[3].nil?\n end\n\n super(logger, level, data, Time.now, f, l, m)\n end", "def log_request\n ServerRequestLog.create! default_log_hash\n end", "def initialize(log, db)\n @log = log\n @database = db\n end", "def initialize(table_name, options = {})\n raise ArgumentError, 'UserContentLogger requires at least a table name as a parameter!' unless table_name.instance_of?(String)\n\n @table_name = table_name\n @log_filename = Rails.root.join(LOG_DESTINATION, \"#{LOG_BASENAME}#{@table_name}.log\")\n @email_on_create = (options[:email_on_create] == true)\n @email_on_destroy = (options[:email_on_destroy] == true)\n end", "def initialize(*args)\n # Handle default\n if args.empty?\n args = [STDOUT]\n end\n\n # Initialization\n @default_level = Logger::Severity::INFO\n @formatter = ::TeeLogger::Formatter.new\n @loggers = {}\n @ios = {}\n\n # Load built-in filters\n load_filters(*args)\n\n # Create logs for all arguments\n args.each do |arg|\n add_logger(arg)\n end\n end", "def initialize(program_name = 'rails')\n @level = Logger::DEBUG\n\n return if defined? SYSLOG\n self.class.const_set :SYSLOG, Syslog.open(program_name)\n end", "def initialize(args)\n @creator_csv = CSV.read(args[:creator_csv_path])\n @title_csv = CSV.read(args[:title_csv_path])\n @contributor_csv = CSV.read(args[:contributor_csv_path])\n @logger = Logger.new(File.join(Rails.root, 'log', 'ordered-metadata-migration.log'))\n end", "def initialize(name, level)\n super($stdout)\n\n @formatter = formatter\n @progname = name\n self.level = level\n end" ]
[ "0.7669621", "0.72301805", "0.7149161", "0.6986685", "0.69864684", "0.69269675", "0.6917172", "0.69040227", "0.68727", "0.6856564", "0.68003935", "0.67769736", "0.6755396", "0.6751251", "0.6697647", "0.66729325", "0.66460323", "0.66335124", "0.66169983", "0.6610713", "0.65660185", "0.6544617", "0.6542203", "0.6528286", "0.6525345", "0.6464593", "0.6435695", "0.64136255", "0.64026827", "0.63992035", "0.6398989", "0.6396399", "0.63929313", "0.634702", "0.632263", "0.6312916", "0.63113266", "0.6304545", "0.62691003", "0.62550926", "0.6253791", "0.62473005", "0.6246798", "0.62427986", "0.6229549", "0.6221839", "0.62049955", "0.61904776", "0.6189735", "0.61847353", "0.6172663", "0.61668605", "0.6164327", "0.6163382", "0.61562353", "0.61520344", "0.61426693", "0.6139471", "0.6135626", "0.611922", "0.6107973", "0.6103194", "0.6098487", "0.6095391", "0.6093043", "0.6093043", "0.6093043", "0.6087833", "0.6082803", "0.6066634", "0.60639465", "0.60623777", "0.6049439", "0.6049158", "0.604453", "0.60431266", "0.6042272", "0.60324985", "0.6022165", "0.6014787", "0.60123026", "0.60111994", "0.601117", "0.5998222", "0.5998222", "0.5998222", "0.5993204", "0.5976244", "0.5952952", "0.59464467", "0.5896345", "0.58871526", "0.5884926", "0.5884048", "0.58779585", "0.5877599", "0.586791", "0.58612883", "0.5847909", "0.5841934", "0.58345115" ]
0.0
-1
Main function for processing entries
def processEntries(data) # Initialise output hash and kick if no data out = {:log => initLog(data), :data => String.new()} # Loop over the data, if any data[:data].each_with_index do |dat, i| # Boot if frowns if dat["smiles"].nil? out[:log] += " No SMILES code for entry #{i + 1}\n" next end # Get OpenBabel output out[:data] += obabelOutput(data[:names].join("; "), dat["smiles"]) end return out end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read(entry); end", "def entry; end", "def entry; end", "def entry; end", "def entry; end", "def process_entry(entry)\n # No-op.\n end", "def entries() end", "def entry_filter; end", "def print_entry(entry)\n\n # Identify method entry\n debug_print \"#{ self } : #{ __method__ }\\n\"\n\n # If no issues for this file, print that and break\n # The filename print is repetative, but reduces another check later\n if !entry[:has_issues]\n if @config.show_type != 'dirty'\n debug_print \"No issues for #{ entry }\\n\"\n print_status \"o\", GREEN\n cprint BOLD + UNDERLINE + GREEN + \"#{ entry[:relative_path] }\" + RESET + \"\\n\"\n return true\n end\n else\n if @config.show_type != 'clean'\n debug_print \"Issues found for #{ entry }\\n\"\n cprint \"\\n\"\n print_status \"x\", RED\n cprint BOLD + UNDERLINE + RED + \"#{entry[:relative_path]}\" + RESET + \"\\n\"\n else\n return true\n end\n end\n\n\n # [review] - Should the tag structure be self contained in the hash\n # Or is it ok to reference @config to figure out the tags\n @config.tag_list.each do | _tag |\n debug_print \"Checking for #{ _tag }\\n\"\n\n # [review] - Better way to ignore tags through structure (hash) data\n # Maybe have individual has_issues for each one?\n if entry[_tag].size.zero?\n debug_print \"#{ _tag } has no issues, skipping\\n\"\n next\n end\n\n debug_print \"#{ _tag } has issues in it, print!\\n\"\n print_status \"#{ _tag }\", BLUE\n cprint \"\\n\"\n\n # Go through each issue in tag\n entry[_tag].each do | _issue |\n cprint WHITE + \" line #{ _issue[:line_number] } - \" + RESET\n cprint BOLD + \"#{ _issue[:title] }\" + RESET\n\n\n # Check to see if it has been resolved on GitHub/Bitbucket\n debug_print \"Checking if issue has been resolved\\n\"\n @config.github_issues[:closed].each do | _closed |\n if _closed[\"body\"].include?(_issue[:md5])\n debug_print \"Found in #{ _closed[:comment] }, not posting\\n\"\n cprint BOLD + \" [\" + RESET\n cprint GREEN + BOLD + \"Resolved on GitHub\" + RESET\n cprint BOLD + \"]\" + RESET\n end\n debug_print \"Did not find in #{ _closed[:comment] }\\n\"\n end\n\n debug_print \"Checking if issue has been resolved\\n\"\n @config.bitbucket_issues[:closed].each do | _closed |\n if _closed[\"content\"].include?(_issue[:md5])\n debug_print \"Found in #{ _closed[\"content\"] }, not posting\\n\"\n cprint BOLD + \" [\" + RESET\n cprint GREEN + BOLD + \"Resolved on Bitbucket\" + RESET\n cprint BOLD + \"]\\n\" + RESET\n end\n debug_print \"Did not find in #{ _closed[\"title\"] }\\n\"\n end\n cprint \"\\n\"\n\n end\n cprint \"\\n\"\n end\n end", "def entries; end", "def entries; end", "def entries; end", "def entries; end", "def parse_entries\n entries = []\n entry_name = nil\n entry_body = []\n\n @content.each_line do |line|\n case line\n when /^\\s*$/ then\n next\n when /^\\w.*/ then\n entries << [entry_name, entry_body] if entry_name\n\n entry_name = $&\n\n begin\n time = Time.parse entry_name\n # HACK Ruby 1.8 does not raise ArgumentError for Time.parse \"Other\"\n entry_name = nil unless entry_name =~ /#{time.year}/\n rescue NoMethodError\n # HACK Ruby 2.1.2 and earlier raises NoMethodError if time part is absent\n entry_name.split ' ', 2\n rescue ArgumentError\n if /out of range/ =~ $!.message\n Time.parse(entry_name.split(' ', 2)[0]) rescue entry_name = nil\n else\n entry_name = nil\n end\n end\n\n entry_body = []\n when /^(\\t| {8})?\\*\\s*(.*)/ then # \"\\t* file.c (func): ...\"\n entry_body << $2\n when /^(\\t| {8})?\\s*(\\(.*)/ then # \"\\t(func): ...\"\n entry = $2\n\n if entry_body.last =~ /:/ then\n entry_body << entry\n else\n continue_entry_body entry_body, entry\n end\n when /^(\\t| {8})?\\s*(.*)/ then\n continue_entry_body entry_body, $2\n end\n end\n\n entries << [entry_name, entry_body] if entry_name\n\n entries.reject! do |(entry,_)|\n entry == nil\n end\n\n entries\n end", "def get_entry(entry); end", "def parse_entry(entry)\n\t\tsubentries = entry.split(@flags[1])\n\t\tsubentries.shift\n\t\tsubentries.each do |subent|\n\t\t\tparse_subentry(subent)\n\t\tend \n\tend", "def parse_all\n while parse_one_entry; end\n end", "def show_entries()\n current_run = current_entry - 1\n puts \"Which run of data would you like to view? (1 - #{current_run})\"\n run_view = gets.chomp #get the run that the user would like to view\n running = 1\n\n while running == 1\n puts \"\"\n puts \"Enter help to see commands, or type in command:\"\n comm = gets.chomp\n\n case comm\n when \"minmax\" #show minimum and maximum\n puts minmax(run_view)\n when \"count\" #show the number of times user called web service\n puts ret_count(run_view)\n when \"results\" #show results ordered\n display_results(run_view)\n when \"noret\" #show what was not shown in results table\n display_order(run_view,2)\n when \"help\"\n show_help\n when \"exit\"\n running = 0\n else\n puts \"That was not a valid command.\"\n end\n end\n\n return\nend", "def on_entry\n end", "def parse(line)\n raise EntryFileError, \"Do not know how to parse the entries in #{File.basename(@data_file)}!\"\n end", "def entry!(*args)\n substitute_values = if args.last.kind_of?(Hash)\n [args.delete_at(-1)]\n elsif args.last.kind_of?(Array)\n args.delete_at(-1)\n else\n []\n end\n \n entry = self.find(self.current_language, *args)\n entry.kind_of?(String) ? substitute_entry(entry, *substitute_values) : entry\n rescue EntryFormatError => e\n raise EntryFormatError.new(e.language, args, e.entry_content, e.format_values, e.original_exception) # reraise with more details\n end", "def process(log_entry, loomio)\n puts(\"Processing %s\" % log_entry.description)\n\n @predefined_entry_types.each do |predefined_entry_type|\n if log_entry.entry_type == predefined_entry_type\n @processors_hash[predefined_entry_type].(log_entry, loomio)\n return\n end\n\n puts(\"Event I don't care about: %s\" % log_entry.entry_type)\n log_entry.loomio_consumed = true\n log_entry.save!\n\n puts(\"Done processing %s\" % log_entry.description)\n end\nend", "def parse_entry(io)\n # Read INSDC or RefSeq entry\n Bio::FlatFile.auto(io).each do |entry|\n @entry = entry\n @features = entry.features\n @source = @features.shift\n parse_sequence\n parse_source\n #parse_genes\n parse_features\n end\n end", "def main\n dict={}\n c=0; p=0\n gtf=gtfread(GTFPATH)\n Dir.glob(DIRECTORY+\"/**/*.pre\").each do |path|\n dict[path.split('/')[-1].split('.')[0]]=process(path, gtf)\n end\n genes,c,p=significant(gtf)\n dc=(C/c).floor\n dp=(P/p).floor\n Dir.glob(DIRECTORY+\"/**/*.pre\").each do |path|\n printer(path.split('.')[0]+\".fc\",dict[path.split('/')[-1].split('.')[0]],gtf,dc,dp,genes,\"foldchange\")\n printer(path.split('.')[0]+\".pval\",dict[path.split('/')[-1].split('.')[0]],gtf,dc,dp,genes,\"pval\")\n end\n bashcommands\nend", "def entry ; nil ; end", "def process_entry( attrs )\n options[:before].call(attrs) if options[:before]\n \n record = finder ? finder.call(attrs) : nil\n\n process_record(attrs,record)\n options[:after].call(record) if options[:after]\n record\n end", "def entry_set; end", "def parse_entry(raw_entry)\n match_data = /#{@entry_regexp}/.match(raw_entry)\n return nil unless match_data\n values = match_data.captures\n values.shift if @multiline\n entry_hash([raw_entry, values].flatten)\n end", "def make_entry()\n\n seq_id = @filehandler.readline.chomp\n puts seq_id\n sequence = @filehandler.readline.chomp\n identifier = @filehandler.readline.chomp\n quality = @filehandler.readline.chomp\n\n Entry.new(seq_id, sequence, identifier, quality)\n end", "def gather_info(entry)\n gathered = false\n while not gathered do\n hsay \"Gathering information for entry '#{entry.title}'\", :information\n\n entry = fill_entry(entry)\n\n # dump the info we have gathered and make sure that\n # it is the input that the user wants to store.\n\n hsay \"-\" * 40, :separator_bar\n hsay entry, :normal\n hsay \"-\" * 40, :separator_bar\n\n gathered = hagree \"Is this information correct? (y/n)\"\n end\n\n entry\n end", "def process_arguments(args)\n begin\n args.keys.sort.each do |k,v|\n case k\n when :quickpkg\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotdevtools?\n raise BoilerMakerErr.new(MSG_NO_DEVTOOLS)\n exit $!\n end\n unless Boilermaker.gothdiutil? \n raise BoilerMakerErr.new(MSG_NO_HDIUTIL)\n exit $!\n end\n project = QuickPkg.new(args)\n # pp project.vars\n project.prep(args)\n project.build(args)\n when :createproj\n project = PkgProj.new(args)\n project.prep\n when :ktcheck\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotradmind? \n raise BoilerMakerErr.new(MSG_NO_RADMIND)\n exit $!\n end\n Radmind.updateK(args)\n when :tconvert\n Radmind.convert(args)\n when :fetch\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotradmind? \n raise BoilerMakerErr.new(MSG_NO_RADMIND)\n exit $!\n end \n Radmind.fetch(args)\n when :boil\n project = PkgProj.new(args)\n project.boil\n when :rollup\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gothdiutil? \n raise BoilerMakerErr.new(MSG_NO_HDIUTIL)\n exit $!\n end\n project = PkgProj.new(args)\n project.rollup\n when :package\n unless Boilermaker.gotroot? \n raise BoilerMakerErr.new(MSG_NO_ROOT)\n exit $!\n end\n unless Boilermaker.gotdevtools?\n raise BoilerMakerErr.new(MSG_NO_DEVTOOLS)\n exit $!\n end\n project = PkgProj.new(args)\n project.package(args)\n end\n end\n rescue => error\n puts error.message + \"\\n\"\n exit 1\n end\n \n end", "def collect()\n\n filename = ARGV[0]\n puts \"[-] opening #{filename}\"\n puts\n f = File.open(filename, \"r\") # user input\n\n\n f.each_with_index do |line, index|\n\t # don't do any of this if the line is nil\n\t if line != nil then\n vuln = line.split('|')\n\t\t # Time Stamps had a array length of 4 and we dont really \n\t\t # care to see timestamps\n\t\t # We want only results\n\t\t # In some cases the results provided no information and the\n\t\t # second line was blank so we got rid of them\n\t\t if vuln.size > 4 && vuln[0] == 'results' && vuln[1] != '' then\n\n type = vuln[TYPE]\n port = vuln[PORT]\n descriptions = vuln[DESCRIPTION].split(\"\\\\n\")\n number = vuln[NUMBER]\n ip = vuln[IP]\n \n # Check if the user wants this result logged\n if log_result?(type) \n\n\t\t\t # Add the ip address to the findings hash and use\n\t\t\t # the result number as the key\n if !$findings[number][port].include?(ip) \n if $onlyip.length > 1\n if $onlyip == ip then\n\t\t\t $findings[number][port].push(ip)\n end\n else\n\t\t\t $findings[number][port].push(ip)\n end\n end\n \n\t \t\t # Store descriptions once in a seperate hash\n descriptions.each do | line |\n line.gsub!(\"\\\\r\", \" \")\n end\n\n # Log what type of vulnerability this is for display\n # later\n log_type(type)\n \n\t \t\t\tinfo = [type, descriptions]\n if !$descriptions[number][info][port].include?(ip)\n\t\t \t\t $descriptions[number][info][port].push(ip)\n end\n end\n\t\t end\n\t end\n end \nend", "def display_events(array)\n array.each do |entry|\n #binding.pry\n puts \"Event: \" + entry.title #hashies let you call keys with a .\n paragraph(entry.description) #hashies let you call keys with a .\n puts \"\"\n puts \"(press Enter to continue or 1 to finish)\"\n gets.to_i == 1 ? break : entry #entry is meaningless here, it just continues the loop.\n end\n h_line\nend", "def run\n # ARGV = [\"FoodDB.txt\", \"DietLog.txt\"]\n if( ARGV.length != 2 )\n puts \"Usage: ruby main.rb FoodDB.txt DietLog.txt\"\n end\n\t\n db = FoodDB.new( ARGV[0] )\n log = Log.new( ARGV[1], db )\n \n puts \"Welcome to the Diet Manager!\"\n printOptions\n \n # use STDIN.gets because .gets defaults input from file (ARGV)\n while command = STDIN.gets.chomp!\n case command\n\twhen \"0\"\n printAll( db )\n\twhen \"1\"\n\t printName( db )\n\twhen \"2\"\n\t findPrefix( db )\n when \"3\"\n\t newFood( db )\n\twhen \"4\"\n\t newRecipe( db )\n\twhen \"5\"\n\t showLog( log )\n\twhen \"6\"\n\t showToday( log )\n\twhen \"7\"\n\t showDate( log )\n\twhen \"8\"\n\t logToday( db, log )\n\twhen \"9\"\n\t logDate( db, log )\n\twhen \"10\"\n\t logRemove( log )\n\twhen \"11\"\n\t save( db, log, ARGV[0], ARGV[1] )\n\twhen \"12\"\n quit( db, log, ARGV[0], ARGV[1] )\n else\n puts \"Invalid Command.\"\n\tend\n\tprintOptions\n end\nend", "def run\n\n # Identify method entry\n debug_print \"#{ self } : #{ __method__ }\\n\"\n\n # Go through all files added from CL (sort them first)\n # If empty, sort and each will do nothing, no errors\n _completed_dirs = Array.new()\n _completed_files = Array.new()\n if @config.cl_entry_set\n @config.file_list.sort.each do |_file|\n _completed_files.push(parse_file(_file))\n end\n end\n\n # Then go through all the specified directories\n # Initial parse depth to parse_dir is 0 (unlimited)\n @config.dir_list.sort.each do |_dir|\n _completed_dirs.push(parse_dir(_dir, 0))\n end\n\n # Create overall hash for parsed files\n _structure = Hash.new()\n _structure[:files] = _completed_files\n _structure[:subdirs] = _completed_dirs\n\n debug_print \"_structure dump\\n\\n\"\n debug_print PP.pp(_structure, '')\n debug_print \"\\n\\n\"\n\n # Pass structure to poster with count as 0\n Remote.post_structure(_structure, @config, 0)\n\n _structure\n end", "def entry(description)\n result = exec \"entry #{description}\", '-f' => append_file\n end", "def parse_input source, options\n entries = if source.match /^http/\n http = Atom::HTTP.new\n\n setup_http http, options\n\n http_to_entries source, options[:complete], http\n elsif source == '-'\n stdin_to_entries\n else\n dir_to_entries source\n end\n\n if options[:verbose]\n entries.each do |entry|\n puts \"got #{entry.title}\"\n end\n end\n\n entries\n end", "def get_info_loop file\n loop do\n line = file.gets\n if line == nil then break end\n words = line.scan(/\\S+/)\n words.each{ |word|\n case word\n when /DONE/\n return\n else\n get_info(word)\n end\n }\n end\nend", "def run_it\n run_through_directory\n file_array_parser\n remove_initial_and_format_change\n array_to_hash\n final_name_info\n create_goal_file\nend", "def process_product (product, entry)\n # binding.pry\n productName = product.at_xpath(\"./ccr:ProductName\")\n brandName = product.at_xpath(\"./ccr:BrandName\")\n productNameText = productName.at_xpath(\"./ccr:Text\")\n brandNameText = brandName.at_xpath(\"./ccr:Text\") \n entry.description = productNameText.content\n process_product_codes(productName, entry) # we throw any codes found within the productName and brandName into the same entry\n process_product_codes(brandName, entry)\n end", "def process_input\n get_collection.each do |entry|\n puts entry[0]\n puts entry[1].sort.map{|k,v| \"#{k}: #{v}\"}.join(', ')\n end\nend", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def process; end", "def load_entries\n @lines = IO.readlines(@filename)\n @lines.each_with_index do |line,idx|\n if entry_klass.is_entry?(line) then\n entry = entry_klass.from_line(line)\n v = { 'entry' => entry, 'line_index' => idx }\n @entries[entry.key] = v\n end\n end\n end", "def process(args)\n args\n end", "def display_feed_entries(argv)\n\tif argv[1].nil?\n\t\tp \"Include a feed ID\"\n\telse\n\t\tp Feed.find_by_id(argv[1]).url\n\t\tFeedEntry.where(:feed_id => argv[1]).each do |entry|\n\t\t\tprint entry.name+\"\\n\\n\"\n\t\t\tprint entry.url+\"\\n\"\n\t\t\tprint Sanitize.clean(entry.content)+\"\\n\"\n\t\t\t2.times do\n\t\t\t\t180.times {print \"*\" }\n\t\t\t\tprint \"\\n\"\n\t\t\tend\n\t\t\tprint \"\\n\"\n\t\t\t50.times { print \"-\" }\t\t\n\t\tend\n\tend\nend", "def test_feed_parse_mk\n props, log = Open3.capture3 \"xargs #{$make} -f #{$src}/feed-parse.mk\", stdin_data: feeds\n assert_equal log.split(\"\\n\")[0..4], [\"Processing test_\", \"Processing Photography\", \"Processing Ruby_Rogues\", \"Processing Stack_Overflow\", \"Processing invalid\"]\n assert_equal props, enclosures\n end", "def extract_target_entries\n extract_host_entries\n extract_event_entries\n extract_service_entries\n extract_note_entries\n extract_vuln_entries\n extract_web_entries\n end", "def main()\n logger = Logger.new(STDOUT)\n logger.level = Logger::DEBUG\n\n\t# Parse command line options\n\toptions = parseOption\n input = parseInput(options[:input])\n\t# Read in config file\n\tconfigfile = File.expand_path(\"~/.biblio/config.yaml\")\n\tconfig = File.exist?(configfile) ? YAML::load_file(configfile) : nil\n\n logger.debug(config)\n logger.debug(options)\n logger.debug(input)\nend", "def parse_entries\n @time_cache ||= {}\n\n if /\\A((?:.*\\n){,3})commit\\s/ =~ @content\n class << self; prepend Git; end\n parse_info($1)\n return parse_entries\n end\n\n entries = []\n entry_name = nil\n entry_body = []\n\n @content.each_line do |line|\n case line\n when /^\\s*$/ then\n next\n when /^\\w.*/ then\n entries << [entry_name, entry_body] if entry_name\n\n entry_name = $&\n\n begin\n time = parse_date entry_name\n @time_cache[entry_name] = time\n rescue ArgumentError\n entry_name = nil\n end\n\n entry_body = []\n when /^(\\t| {8})?\\*\\s*(.*)/ then # \"\\t* file.c (func): ...\"\n entry_body << $2.dup\n when /^(\\t| {8})?\\s*(\\(.*)/ then # \"\\t(func): ...\"\n entry = $2\n\n if entry_body.last =~ /:/ then\n entry_body << entry.dup\n else\n continue_entry_body entry_body, entry\n end\n when /^(\\t| {8})?\\s*(.*)/ then\n continue_entry_body entry_body, $2\n end\n end\n\n entries << [entry_name, entry_body] if entry_name\n\n entries.reject! do |(entry,_)|\n entry == nil\n end\n\n entries\n end", "def view_all_entries\n # #14 - iterate through all entries in AddressBook\n address_book.entries.each do |entry|\n system \"clear\"\n puts entry.to_s\n # #15 call entry_submenu to display submenus for each entry\n entry_submenu(entry)\n end\n\n system \"clear\"\n puts \"End of entries\"\n end", "def entry_set=(_arg0); end", "def main\n \n operations.each do |op|\n in_collection = op.input(INPUT).collection\n keep_plt = op.input(KEEP_PLT).val.to_s\n \n # export_filename(collection=in_collection, method='timeseries', timepoint=20) # timepoint is duration of timeseries plate reader\n filename = Item.find(in_collection.id).get('timeseries_filename')\n \n # Directs tech through biotek plate reader software in order to export time series measurements\n export_timeseries_data(filename)\n \n # Find measurements and upload\n show {\n title \"Locating Upload\"\n separator\n note \"The file you just exported should be in the <b>'_UWBIOFAB'</b> directory\"\n note \"It is called: #{filename}\"\n }\n # Show block upload button and retrieval of file uploaded\n up_show, up_sym = upload_show(filename)\n if (up_show[up_sym].nil?)\n show {warning \"No upload found for Plate Reader measurement. Try again!!!\"}\n up_show, up_sym = upload_show(filename)\n else\n upload = find_upload_from_show(up_show, up_sym)\n key = \"#{filename}\"\n associate_to_plans(key, upload)\n associate_to_item(in_collection, key, upload)\n end\n \n (keep_plt == 'No') ? (in_collection.mark_as_deleted) : (in_collection.location = 'Bench')\n in_collection.save\n if (keep_plt == 'No')\n show {\n title \"Cleaning Up...\"\n separator\n note \"Rinse out Plate <b>#{in_collection}</b> with DI H2O and bleach\"\n note \"Then rinse once more with EtOH\"\n }\n else\n show {\n title \"Cleaning Up...\"\n separator\n note \"Move <b>#{in_collection}</b> to <b>#{in_collection.location}</b>\"\n }\n end\n end\n \n end", "def process_product (product, entry)\n productName = product.at_xpath(\"./ccr:ProductName\")\n brandName = product.at_xpath(\"./ccr:BrandName\")\n productNameText = productName.at_xpath(\"./ccr:Text\")\n brandNameText = brandName.at_xpath(\"./ccr:Text\") if brandName\n entry.description = productNameText.content if productNameText\n process_product_codes(productName, entry) # we throw any codes found within the productName and brandName into the same entry\n process_product_codes(brandName, entry) if brandName\n end", "def entryMaker(url)\n\n # set up for image links\n img_base = \"http://www.comicstriplibrary.org\"\n\n curPage = Nokogiri::HTML(open(url))\n\n curEntry = {}\n curTable = curPage.css(\"table#metadata\") \n\n # regexes strip id and stores it.\n foundID = url.match(/\\/(\\d+)/).to_s\n foundID.gsub!(/\\//,'')\n curEntry['comic_id'] = foundID\n puts \"I.D. added! it is #{foundID}\"\n \n curTable.css(\"tr\").each do |row|\n case row.css('th').text\n\n when \"Title\"\n curEntry['title'] = row.css('td').text.strip\n\n when \"Author\"\n curEntry['author'] = row.css('td').text.strip\n\n when \"Date Published\"\n cleaned_row = row.css('td').text.strip\n rawDate = cleaned_row.gsub(/^(\\d{4})-(\\d{2})-(\\d{2})\\s-\\s([a-zA-Z]+)/,'\\4, \\2-\\3-\\1')\n simpleDate = cleaned_row.gsub(/^(\\d{4})-(\\d{2})-(\\d{2})\\s-\\s([a-zA-Z]+\\s)/,'\\2-\\3-\\1')\n\n # for a friendlier date string\n curEntry['date_display'] = rawDate\n\n # standardized dates, to be sorted against\n begin\n parsedDate = Date.parse(simpleDate)\n curEntry['date_published'] = parsedDate\n rescue StandardError => e\n yearOnly = rawDate.match(/\\d{4}$|\\d{4}\\s$/)\n curEntry['date_published'] = yearOnly\n next\n end\n\n # curEntry['date_published'] = parsedDate\n\n when \"Summary\"\n curEntry['summary'] = row.css('td').text.strip\n\n when \"Characters\"\n cleaned_row = row.css('td').text.strip\n cleaned_row.gsub!(/\\n\\s+|\\n/, \"\")\n curEntry['characters'] = cleaned_row.split(',').collect(&:strip) \n\n when \"Contents\"\n cleaned_row = row.css('td').text.strip\n cleaned_row.gsub!(/\\n\\s+|\\n|\\_\\(\\d+\\)/, \"\")\n cleaned_row.gsub!(/\\_/,\" \")\n curEntry['contents'] = cleaned_row.split(',').collect(&:strip) \n\n when \"Notes\"\n curEntry['notes'] = row.css('td').text.strip\n\n when \"Transcript\"\n if row.text.match(/transcribe/)\n curEntry['transcript'] = false\n else\n curEntry['transcript'] = true\n curEntry['transcript_text'] = row.css('td').text.strip\n end\n\n end\n\n end\n\n\n this_img = curPage.css(\"#display-wrapper img\").map { |link| link[\"src\"] }[0]\n img_url = img_base + this_img\n\n # add standard img link\n curEntry['img'] = img_url\n\n # add smaller/thumb img link\n thumb = img_url.gsub(/-s/,\"-tn\")\n curEntry['img_thumb'] = thumb\n\n # add hi-res img link\n hiRes = img_url.gsub(/-s/,\"-l\")\n curEntry['img_link'] = hiRes\n\n return curEntry\n end", "def main(cmlInput)\n\temaillist,finalPrint = [],[]\n\temailXML = \"emails.xml\"\n\targm = nil\n\n\thelp(cmlInput.index(\"help\"))\n\t\n\targm = cmlInput.index(\"-xml\")\n\temailXML = cmlInput[argm+1] if argm != nil\n\n\temaillist = openFile(emaillist,emailXML)\n\t\n\targm = cmlInput.index(\"list\")\n\tif(argm)\n\t\tcmlValue = cmlInput[argm+2]\n\t\tfinalPrint = sch(emaillist,finalPrint,cmlInput,argm,\"--ip\" \n\t\t) {|e| true if e.ip_address.eql? cmlValue}\n\t\t\n\t\tfinalPrint = sch(emaillist,finalPrint,cmlInput,argm,\"--name\" \n\t\t\t) {|e| true if\n\t\t\te.first_name.downcase.include? cmlValue.downcase or\n\t\t\te.last_name.downcase.include? cmlValue.downcase }\n\t\t\n\t\tfinalPrint = sch(emaillist,finalPrint,cmlInput,argm,\"--email\"\n\t\t) {|e| true if e.email == cmlValue}\n\t\t\n\t\t\n\t\texit if finalPrint == []\n\tend\n\t\n=begin\n\tThis converts the string to a date, then uses strftime to work out\n\twhat day it is then finds out if the input you typed in includes the \n\tday.\n=end\n\t\n\targm = cmlInput.index(\"--day\")\n\tif(argm)\n\t\temaillist.each {|e| finalPrint.push(e) if Date.parse(e.send_date\n\t\t).strftime(\"%A\").downcase.include? cmlInput[argm+1].downcase} if\n\t\tcmlInput[argm].eql? \"--day\"\n\tend\n\t\n\tfinalPrint = beforeAfter(emaillist,finalPrint,cmlInput) if \n\tcmlInput.index(\"before\") != nil or cmlInput.index(\"after\") != nil\n\t\n\tputs jsonFinal(finalPrint)\nend", "def get_multiple_entries (entries)\n\n\t\tif entries.nil? then\n\t\t\treturn \"{}\"\n\t\tend\n\nputs \"get_multiple_entries: #{entries}\"\n#\t\tq_string = entries[:uniprotIds].join(',')\n\t\tentries_pairs = entries.split(',')\n\t\taccessions = entries_pairs.map { |it|\n\t\t\tit.split(';')[0]\n\t\t}\n\t\tq_string = accessions.join(',')\n\t\turl = DBFETCH_URL.gsub(/xxxx/, q_string)\n\n\t\toptions = {}\n\t\tsubstring = ''\n\t\tif options[:limit].nil? then\n\t\t\toptions[:limit] = @limit\n\t\tend\n\t\toptions[:q] = substring\n\n#\t\turl = URI.parse(req_url)\n\t\tresults = request(url, options)\n\t\tif results.body == \"\" then # no concept found\n\t\t\tputs \"No concept found!\"\n\t\t\t@parsed_results = {:concept_uuid => nil, :concept_label => nil, :tag_uuid => nil, :tag_label => nil}\n\t\t\treturn @parsed_results\n\n\t\telsif results.code.to_i != 200 then\n\t\t\tputs \"DBFetch service is not working properly!\"\n\t\t\treturn nil\n\n\t\telse\n\t\t\t# from dbfetch service, what we get is xml\n\t\t\tuniprotxml2json (results.body)\n#\t\t\treturn true\n\t\tend\n\n\tend", "def read_entries(file)\n archive = entries(file)\n entries(file).each do |entry|\n yield(entry.get_input_stream.read)\n end\n return unless archive.count.positive?\n puts format LOC.finished_reading, file: file.path\n file.rm\n end", "def display_description(array)\n trash = []\n array.each do |entry|\n trash.push(entry) if entry.description == \"\" #puts any search result with no description into trash\n end\n array = array - trash\n #binding.pry\n if array == []\n puts \"Sorry, no detailed entries found.\"\n puts \"\"\n else\n counter = 0\n puts array.length.to_s + \" results from the Marvel database:\"\n h_line\n array.each do |entry|\n counter +=1\n puts counter.to_s + \": \" + entry[\"name\"]\n end\n end\n h_line\n puts \"Additional entries with no description:\"\n trash.each do |entry|\n puts \" - \" + entry[\"name\"]\n end\n #binding.pry\n h_line\n puts \"Enter a number you would like more info on.\" if array != []\n puts \"0 or a non-number will return to SEARCH.\"\n input = gets.to_i\n (input != 0) ? more_info(input,array) : search\nend", "def parse_entries(text)\n # Have to add final blank line because it gets lost on the #split\n lines = text.split(\"\\n\") << ''\n Array.new.tap do |parsed_entries|\n entry_string = ''\n\n lines.count.times do |line_number|\n if (((line_number + 1) % 4) == 0)\n parsed_entries << entry_string.chomp\n entry_string = ''\n else\n entry_string += lines[line_number] + \"\\n\"\n end\n end\n end\n end", "def main()\n if ARGV.size < 2\n print \"ERROR, not enough arguments\"\n end\n\n #Alright, first, let's load up some files\n prefix = ARGV[0]\n value = ARGV[1]\n value = value.to_f\n\n # print \"Value is: \" << value.to_s << \"\\n\" \n\n data = []\n files = []\n\n #Move into the prefix directory\n Dir.chdir( prefix )\n #Get the file names\n files = Dir.glob(\"*\")\n\n index = 0\n #Get all the filenames\n for file in files\n #And extract all the data\n data = (extract_data(file, value))\n #Show the mapping\n new_name = file + \".new\"\n print file << \" => \" << new_name << \"\\n\"\n \n fout = File.open(new_name, \"w\") \n for i in 0 .. (data.size()-1)\n for j in 0 .. (data[i].size()-1)\n fout << data[i][j] << \" \"\n end\n fout << \"\\n\"\n end\n fout.close\n end\n\nend", "def main\n operations.each { |op|\n template = [['sample: Sample Name', '', '', '', ''],['title: Title 1', 'title 1\\'s step 1', 'title 1\\'s step 2','title: Title n', '...'],['Ingredient 1', 'Ingredient 1\\'s quantity', 'Ingredient k', 'Ingredient k\\'s quantity', '...']]\n show {\n title \"File format (csv)\"\n table template\n }\n \n ups = upload_file\n if ups.nil?\n show { note \"No files found...\"}\n return\n end\n\n file = ups[0]\n data = read_url(file)\n \n # Remove nils from the data array.\n remove_data_nils data\n \n if(data.empty?)\n show { note \"no data, returning...\" } \n return\n end\n \n # Look through data for duplicates\n create_samples data\n \n }\n end", "def process(*)\n end", "def main; end", "def clean_entry(entry)\n fields_to_check = [ :author, :title, :journal, :publisher, :booktitle,\n :month, :institution ]\n\n return unless entry.methods.include?(\"fields\".to_sym)\n entry.fields.each do |f, value|\n #puts \"Checking field #{f} for entry #{entry}\"\n next unless fields_to_check.include?(f) or !(entry[f].nil?)\n entry[f] = standardize_capitialization(entry[f])\n end\nend", "def main\n\n end", "def flush_buffer()\n\t\t##debug(sprintf(\"flus %s\\n\",@entries.inspect()))\n\t\t@entries.each{|h,e|\n\t\t\tinfos=Hash.new\n\t\t\tinfos[:xlated_word]=Hash.new\n\t\t\thtml_txt=\"\"\n\t\t\tif e.size > 1\n\t\t\t\ti = 1 \n\t\t\telse\n\t\t\t\ti = 0 \n\t\t\tend\n\t\t\tsorted=e.sort.to_h\n\t\t\tfirst_entry=sorted.first[1]\n\t\t\texamples=[]\n\t\t\tif first_entry[\"key_words\"].index(\"$phrase$\") != nil\n\t\t\t\t## Special case TMX \n\t\t\t\tsorted.each{|entry_num,entry|\n\t\t\t\t\thtml_txt << build_tmx_text(entry['dict_id'],entry['entry_data'],entry[\"key_lang\"],i.to_s)\n\t\t\t\t\ti = i + 1 \n\t\t\t\t\tex = Hash.new\n\t\t\t\t\tentry['entry_data'].each{|tag,value|\n\t\t\t\t\t\tnext if tag[0,7]!=\"#PHRASE\"\n\t\t\t\t\t\tex[tag[8,2]]=value\n\t\t\t\t\t}\n\t\t\t\t\texamples << ex\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t## normal case : regular dictionary entry\n\t\t\t\tsorted.each{|entry_num,entry|\n\t\t\t\t\t## collects all xlated and build html text\n\t\t\t\t\tentry['xlated_word'].each{|lang,words|\n\t\t\t\t\t\tinfos[:xlated_word][lang]=Hash.new if infos[:xlated_word][lang]==nil\n\t\t\t\t\t\twords.each{|w|\n\t\t\t\t\t\t\tinfos[:xlated_word][lang][w]=w\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thtml_txt << build_text(entry['dict_id'],entry['entry_data'],entry[\"key_lang\"],i.to_s)\n\t\t\t\t\ti = i + 1 \n\t\t\t\t\tentry['entry_data'].each{|tag,value|\n\t\t\t\t\t\tnext if tag[0,9]!=\"#EXAMPLES\"\n\t\t\t\t\t\tget_examples(value).each{|ex|\n\t\t\t\t\t\t\texamples << ex\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinfos[:xlated_word].each{|lang,x|\n\t\t\t\t\t### eliminate duplicated keys!\n\t\t\t\t\tinfos[:xlated_word][lang]= x.keys\n\t\t\t\t}\n\t\t\tend\n\t\t\tinfos[:examples]=examples\n\t\t\tdo_add_entry(first_entry,\n\t\t\t\t \"<html>\"+html_txt+\"</html>\",\n\t\t\t\t infos)\n\t\t}\n\tend", "def entry_filter(args)\n if args.length == 1 && args.first.is_a?(String)\n { id: @api.normalize_id(args.first) }\n elsif args.length == 2\n { name: args.first, version: args.last }\n else\n raise ArgumentError\n end\n end", "def run\n cmd = \"default\"\n until cmd == \"end\" do\n cmd = Readline.readline(\"[issue ##{@issue.id}] \") || \"\"\n cmd.chomp!\n\n case cmd\n when /^new/ then new_entry\n when /^(ls|show)/ then show_entries\n when /^desc/ then describe_issue\n when /^delete/ then delete_entry(cmd.split.drop 1)\n when /^edit/ then EditHandler.new(@issue).edit_what(cmd.split.drop 1)\n when /^concat/ then concat_description\n when /^replace/ then replace_pattern\n when /^search/ then search_term((cmd.split.drop 1).join ' ')\n when /^lt/ then time(cmd.split.drop 1) # lt for log time\n when /^forget/ then cmd = \"end\"\n when /^finish/ then finish ? cmd = \"end\" : nil\n when /^attachout/ then output_attach\n when /^attachls/ then show_attach\n when /^attach/ then attach\n when /^help/ then print_help\n when /^end/ then next\n else puts \"Type 'help' for help\"\n end\n end\n end", "def main(argv)\n # override this; no default action in main\n end", "def __read_info_entry(entries)\n info_entry = entries.detect do |entry|\n entry[:chunks] == ['info']\n end\n info_entry ||= {}\n # if there is an info entry, remove it from the array\n # so we don't process it as a seperate stream\n entries.delete(info_entry)\n # return the attributes\n info_entry[:attributes]\n end", "def each\r\n @input.rewind\r\n \r\n @input.each do |line|\r\n if line =~ REGEXP_ENTRY\r\n yield $1\r\n end\r\n end\r\n end", "def entry_order=(_arg0); end", "def parseInput(args)\n\t# in case it is a full path, get only the filename part\n\targstr = File.basename(args.join(\" \").strip())\n\t# remove filename extensions\n\twhile argstr.sub!(/\\.[a-zA-Z2]{1,5}/,''); end\n\t# Case 1: LC control number\n\tif argstr.start_with?('lccn:') then\n\t\treturn {'lccn' => argstr.sub!('lccn:','')}\n\tend\n\t# Case 2: worldcat query string\n\ttokens = argstr.split(/\\b(author|isbn|keyword|title)=/).drop(1)\n\tif tokens.length > 1 then\n\t\treturn Hash[*tokens]\n\tend\n\t# Case 3: ISBN10 or ISBN13\n\tfor i in 0..(argstr.length - 13) do\n\t\treturn {'isbn' => argstr[i..(i+12)]} if isbn13?(argstr[i..(i+12)])\n\tend\n\tfor i in 0..(argstr.length - 10) do\n\t\treturn {'isbn' => argstr[i..(i+9)]} if isbn10?(argstr[i..(i+9)])\n\tend\n\t# Case 4: Semicolon-separated pieces (probably filename without extension)\n\ttokens = argstr.split(\";\")\n\tret = {}\n\tif tokens.length == 3 then # fulltitle;authors;year\n\t\tret['fulltitle'] = tokens[0].gsub(/[-_]/, ' ')\n\t\tret['year'] = tokens[2].gsub(/[^\\d]/,'')\n\t\tif tokens[1] =~ /^([a-zA-Z]+-)?(.*)$/ then\n\t\t\tret['author'] = $2 if $2.length > 0\n\t\tend\n\telsif tokens.length > 1 then\n\t\tret['fulltitle'] = tokens.shift.gsub(/[-_]/, ' ')\n\t\tauthor = tokens.drop_while{|x| x =~ /[^a-zA-Z\\s]/}.first\n\t\tret['author'] = author unless author.nil?\n\telse\n\t\tret['fulltitle'] = argstr.gsub(/[-_]/, ' ')\n\tend\n\tret['fulltitle'] = ret['fulltitle'].gsub(/\\(.*\\)/,'').gsub(/ +/,' ').strip\n\tret['fulltitle'].match(/\\b(\\d+)e$/) { |m|\n\t\tret['edition'] = m[1]\n\t\tret['fulltitle'].sub!(/\\b\\s*\\d+e$/,'')\n\t}\n\tret['title'] = ret['fulltitle'].sub(/\\..*$/,'').strip()\n\treturn ret\nend", "def main\n if ARGV.empty?\n puts \"Usage: ruby #{File.basename($0)} EPUBFILE [EPUBFILE ...]\"\n exit 1\n end\n\n puts make_catalog(ARGV)\nend", "def parseEntry(path, deadline, counter)\n\t\n\tdef entryScore(key, value)\n\t\tif value >=3\n\t\t\tif @results[key] == nil then @results[key] = initializeStudent() end\n\t\t\t@results[key][\"VH\"] += 1\n\t\tend\n\tend\n\t\n\ttmp = Hash.new\n\ttmpOnTime = Hash.new\n\tDir.glob(ARGV[0] + \"#{path}\").each do |file|\n\t\t\n\t\tname = file.split(\"/\").last.split(\"_\")\n\t\t\n\t\tfirstName = name[0].capitalize\n\t\tlastName = name[1].capitalize\n\t\t\n\t\tname = firstName + ' ' + lastName\n\t\t\n\t\tif tmp[name] == nil\n\t\t\ttmp[name] = 0\n\t\t\ttmpOnTime[name] = 0\n\t\tend\n\t\t\n\t\tif (is_on_time?(deadline, file) == 2)\n\t\t\ttmpOnTime[name] = tmpOnTime[name] + 1\n\t\tend\n\t\t\n\t\ttmp[name] += 1\n\tend\n\t\n\ttmpOnTime.each do |key, value|\n\t\tentryScore(key, value)\n\tend\n\t\n\ttmp.each do |key, value|\n\t\tentryScore(key, value)\n\tend\n\t\n\tcounter += 1\n\t\n\tif counter == @n\n\t\t\n\t\treturn 0\n\t\t\n\tend\n\t\nend", "def work_entry(conf)\n lambda do |rec, acc|\n Traject::MarcExtractor.cached(conf, :alternate_script => false)\n .each_matching_line(rec) do |field, spec, extractor|\n\n next unless passes_work_entry_constraint?(field, rec)\n next unless subfield_5_absent_or_present_with_local_code?(field)\n\n work_entry = assemble_work_entry_hash(field, rec)\n\n acc << work_entry unless work_entry.empty?\n end\n acc.uniq!\n end\n end", "def parse_entry(line)\n\n return nil if line.nil? || line.length <= 0\n meta,msg = line.split(' : ',2)\n msg = msg.chomp unless msg.nil?\n\n parts=meta.split(' ')\n\n fields=[]\n\n unless parts.length < 3\n fields_str=parts[2][1..-2]\n fields = fields_str.split(',')\n end\n\n Entry.new(parts[0], parts[1], fields, msg, line)\n end", "def main()\n case ARGV[0]\n when \"--list\"\n cd_source = CDSource.new CACHE_FILE, SOURCE_DIRS, nil, MAX_LEVEL\n cd_source.list()\n when \"--delete\"\n cd_source = CDSource.new CACHE_FILE, SOURCE_DIRS, nil, MAX_LEVEL\n cd_source.delete(ARGV[1])\n when \"--set\"\n cd_source = CDSource.new CACHE_FILE, SOURCE_DIRS, nil, MAX_LEVEL\n cd_source.set(ARGV[1], ARGV[2])\n when \"--help\", \"-h\"\n puts HELP_INFO\n exit 1\n else\n cd_source = CDSource.new CACHE_FILE, SOURCE_DIRS, ARGV[0], MAX_LEVEL\n cd_source.search()\n end\nend", "def entry\n instructions[1]\n end", "def main \n settings = {}\n settings[\"--minAD\"] = 6 ## min # of reads carrying alternative allele for SNV\n settings[\"--minADIndel\"] = 8 ## min # of reads carrying alternative allele for indel\n settings[\"--minDP\"] = 12 # min depth in parents\n settings[\"--phenotype\"] = \"\"\n settings[\"--minPL\"] = 70\n settings[\"--minPLP\"] = 30\n settings[\"--minPLIndel\"] = 80\n settings[\"--maxAAF\"] = 0.015\n settings[\"--maxFreq\"] = 0.001\n settings[\"--maxAC\"] = 3\n\n optHash = getopt()\n vcf = optHash[\"--vcf\"]\n \n settings[\"--output\"] = vcf \n settings[\"--header\"] = vcf\n settings.keys.sort.each do |s|\n if optHash.key?(s) \n if s == \"--phenotype\" or s == \"--output\" or s == \"--header\"\n settings[s] = optHash[s]\n else\n settings[s] = optHash[s].to_f\n end\n end\n end\n \n\n samples=countSamples(settings[\"--phenotype\"], settings[\"--header\"])\n\n # $stderr.puts samples\n \n filterVCF(vcf,settings,samples) # gt: gene -> pos -> sample -> genotype, \n\nend", "def main\n @t.each do \n |line|\n info = grab_info(line) # grabs the info from an PRIVMSG\n STDOUT.puts line, \"\\n\" # puts to the console\n ##\n # An IRC client (a bot is a client) must respond to PINGs from the IRC server.\n # If not, the bot will be kicked.\n pong(line) if line[0..3] == \"PING\"\n if info and info[4] # only called if grabbing the info was successful\n log_it info # logs in a friendly format, in chat.txt\n ##\n # Are there any commands? This bot won't even check for a command unless it starts with a dot (.)\n # and the caller is authorized\n check_for_cmd(info[4], info[0]) if info and info[4] =~ /^\\.(.+)/ and auth(info)\n self.check_for_greet(info[4], info[0]) if info[4].include?(@config[:nick]) # should i respond with a greeting?\n if @config[:mode] == \"trivia\"\n check_answer(info[4], info[0]) # did the user answer correctly?\n end\n end\n end\n end", "def main\n c=[]\n File.open(CLUSTERS,'r').each {|line| c << line.chomp.split(\"\\t\") unless (line.include?(\"Cr\") || line.include?(\"Ct\"))}\n gtf=positions\n process(c,gtf)\n printlabels(gtf)\nend", "def main\n arg_parser=GetoptLong.new\n arg_parser.set_options(\n [\"-e\", \"--exclude\", GetoptLong::REQUIRED_ARGUMENT],\n [\"-i\", \"--include\", GetoptLong::REQUIRED_ARGUMENT],\n [\"-h\", \"--headers\", GetoptLong::NO_ARGUMENT],\n [\"-u\", \"--usage\", GetoptLong::NO_ARGUMENT])\n\n arg_parser.each do |opt, arg|\n begin\n case opt\n when \"-u\"\n usage()\n exit(0);\n when \"-h\"\n printHeader\n when \"-i\"\n $includes.push(arg)\n when \"-e\"\n $excludes.push(arg)\n end\n rescue => err; puts err; break;\n end\n end\n\n # after all args if we still don't have a directory then show usage\n if (ARGV.length != 1)\n usage();\n end\n\n # convert strings to regexs once, rather than during filtering loop\n $excludes.collect! {|str| Regexp.new(str)}\n $includes.collect! {|str| Regexp.new(str)}\n\n processTags(getFiles(ARGV.shift))\n return\nend", "def execute\n setup\n begin\n data = main\n rescue ArgumentError => e\n warn e.message\n exit 1\n end\n puts format_data(data)\n end", "def main()\n res = @s.execute_get(@s.url_for(\"var/search/needsprocessing.json\"))\n unless res.code == '200'\n raise \"Failed to retrieve list to process [#{res.code}]\"\n end\n\n process_results = JSON.parse(res.body)['results']\n log \"processing #{process_results.size} entries\"\n unless process_results.size > 0\n return\n end\n\n # Create some temporary directories.\n Dir.mkdir DOCS_DIR unless File.directory? DOCS_DIR\n Dir.mkdir PREV_DIR unless File.directory? PREV_DIR\n Dir.mkdir PDFS_DIR unless File.directory? PDFS_DIR\n\n # Create a temporary file in the DOCS_DIR for all the pending files and outputs all the filenames in the terminal.\n Dir.chdir DOCS_DIR\n queued_files = process_results.collect do |result|\n FileUtils.touch result['_path']\n end\n\n log \" \"\n log \"Starts a new batch of queued files: #{queued_files.join(', ')}\"\n\n Dir['*'].each do |id|\n FileUtils.rm_f id\n log \"processing #{id}\"\n\n begin\n meta_file = @s.execute_get @s.url_for(\"p/#{id}.json\")\n unless meta_file.code == '200'\n raise \"Failed to process: #{id}\"\n end\n\n meta = JSON.parse meta_file.body\n mime_type = meta['_mimeType']\n given_extension = meta[\"sakai:fileextension\"]\n extension = determine_file_extension_with_mime_type(mime_type, given_extension)\n filename = id + extension\n log \"with filename: #{filename}\"\n\n if ignore_processing?(mime_type) || extension.eql?('')\n if extension.eql?('')\n log \"ignoring processing of #{filename}, no preview can be generated for files without a known mime type\"\n log \"The file's original extension was #{given_extension}, and it's mime type is #{mime_type}\"\n else\n log \"ignoring processing of #{filename}, no preview can be generated for #{mime_type} files\"\n end\n else\n # Making a local copy of the file.\n content_file = @s.execute_get @s.url_for(\"p/#{id}\")\n unless ['200', '204'].include? content_file.code\n raise \"Failed to process file: #{id}, status: #{content_file.code}\"\n end\n File.open(filename, 'wb') { |f| f.write content_file.body }\n\n if process_as_image? extension\n extension = output_extension extension\n page_count = 1\n filename_thumb = 'thumb' + extension\n\n content = resize_and_write_file filename, filename_thumb, 900\n post_file_to_server id, content, :normal, page_count, extension\n\n content = resize_and_write_file filename, filename_thumb, 180, 225\n post_file_to_server id, content, :small, page_count, extension\n\n FileUtils.rm_f DOCS_DIR + \"/#{filename_thumb}\"\n else\n begin\n # Check if user wants autotagging\n user_id = meta[\"sakai:pool-content-created-for\"]\n user_file = @s.execute_get @s.url_for(\"/system/me?uid=#{user_id}\")\n unless user_file.code == '200'\n raise \"Failed to get user: #{uid}\"\n end\n user = JSON.parse(user_file.body)\n if user[\"user\"][\"properties\"][\"isAutoTagging\"] != \"false\"\n # Get text from the document\n Docsplit.extract_text filename, :ocr => false\n text_content = IO.read(id + \".txt\")\n terms = extract_terms(text_content)\n tags = \"\"\n terms.each_with_index do |t, i|\n tags += \"- #{t}\\n\"\n terms[i] = \"/tags/#{t}\"\n end\n # Generate tags for document\n @s.execute_post @s.url_for(\"p/#{id}\"), {':operation' => 'tag', 'key' => terms}\n log \"Generate tags for #{id}, #{terms}\"\n admin_id = \"admin\"\n origin_file_name = meta[\"sakai:pooled-content-file-name\"]\n if not terms.nil? and terms.length > 0 and user[\"user\"][\"properties\"][\"sendTagMsg\"] and user[\"user\"][\"properties\"][\"sendTagMsg\"] != \"false\"\n msg_body = \"We have automatically added the following tags for #{origin_file_name}:\\n\\n #{tags}\\n\\nThese tags were created to aid in the discoverability of your content.\\n\\nRegards, \\nThe Sakai Team\"\n @s.execute_post(@s.url_for(\"~#{admin_id}/message.create.html\"), {\n \"sakai:type\" => \"internal\",\n \"sakai:sendstate\" => \"pending\",\n \"sakai:messagebox\" => \"outbox\",\n \"sakai:to\" => \"internal:#{user_id}\",\n \"sakai:from\" => \"#{admin_id}\",\n \"sakai:subject\" => \"We've added some tags to #{origin_file_name}\",\n \"sakai:body\" => msg_body,\n \"_charset_\" => \"utf-8\",\n \"sakai:category\" => \"message\"\n })\n log \"sending message from #{admin_id} user to #{user_id}\"\n end\n end\n rescue Exception => msg\n log \"failed to generate document tags: #{msg}\", :warn\n end\n\n # Generating image previews of the document.\n if only_first_page? extension\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg, :pages => 1\n else\n Docsplit.extract_images filename, :size => '1000x', :format => :jpg\n end\n\n # Skip documents with a page count of 0, just to be sure.\n next if Dir[id + '_*'].size == 0\n\n Dir.mkdir PREV_DIR + \"/#{id}\" unless File.directory? PREV_DIR + \"/#{id}\"\n\n # Moving these previews to another directory: \"PREVS_DIR/filename/index.jpg\".\n Dir[id + '_*'].each_with_index do |preview, index|\n FileUtils.mv \"#{id}_#{index + 1}.jpg\", \"#{PREV_DIR}/#{id}/#{index}.jpg\"\n end\n\n Dir.chdir PREV_DIR + \"/#{id}\"\n page_count = Dir[\"*\"].size\n\n # Upload each preview and create+upload a thumbnail.\n for index in (0..page_count - 1)\n filename_p = \"#{index}.jpg\"\n # Upload the generated preview of this page.\n nbytes, content = File.size(filename_p), nil\n File.open(filename_p, \"rb\") { |f| content = f.read nbytes }\n post_file_to_server id, content, :large, index + 1\n\n # Generate 2 thumbnails and upload them to the server.\n filename_thumb = File.basename(filename_p, '.*') + '.normal.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 700\n post_file_to_server id, content, :normal, index + 1\n\n filename_thumb = File.basename(filename_p, '.*') + '.small.jpg'\n content = resize_and_write_file filename_p, filename_thumb, 180, 225\n post_file_to_server id, content, :small, index + 1\n end\n\n FileUtils.remove_dir PREV_DIR + \"/#{id}\"\n end\n # Pass on the page_count\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:pagecount\" => page_count, \"sakai:hasPreview\" => \"true\"}\n\n # Change to the documents directory otherwise we won't find the next file.\n Dir.chdir DOCS_DIR\n end\n\n #SAKAI TO PDF\n # We check if mimetype is sakaidoc\n if(mime_type == \"x-sakai/document\")\n if (File.exist?(\"../wkhtmltopdf\"))\n # Go to PDF Dir\n Dir.chdir PDFS_DIR\n\n #delay in secs\n $delay = \"20\"\n\n #filename with extension\n filename_p = id + \".pdf\"\n\n # We parse the structure data to var structure (we do not need the rest)\n structure = JSON.parse meta['structure0']\n\n # Create var and add beginning of code line to run\n line = \"../wkhtmltopdf \"\n\n # Go through structure and add the pagelink for each page id\n structure.each do |page|\n link = \"content#l=\" + page[0] + \"&p=\" + id\n link = @s.url_for(link)\n link = \"'\" + link + \"' \"\n line += link\n end\n\n # Fetch cookie value to get access to all content\n # USERNAME PASSWORD SERVER\n $username = \"admin\"\n auth = \"../auth.sh \" + $username + \" \" + $pw + \" \" + $preview_referer\n cookietoken = `#{auth}`\n\n # Append end of line containing arguments for print css, delay and authentication\n line += filename_p + \" --print-media-type --redirect-delay \" + $delay + \"000 --cookie 'sakai-trusted-authn' \" + cookietoken\n\n # Run the command line (run wkhtmltopdf)\n `#{line}`\n\n # We read the content from the pdf in the PDF directory\n content = open(filename_p, 'rb') { |f| f.read }\n\n # We post it to server through this function\n post_pdf_to_server id, content\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"false\"}\n #Change dir\n Dir.chdir DOCS_DIR\n else\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n log \"PDF Converter (wkhtmltopdf) not present in directory\"\n log \"Cannot convert Sakai document to PDF\"\n log \"Continuing without conversion\"\n end\n end\n rescue Exception => msg\n # Output a timestamp + the error message whenever an exception is raised\n # and flag this file as failed for processing.\n log \"error generating preview/thumbnail (ID: #{id}): #{msg.inspect}\\n#{msg.backtrace.join(\"\\n\")}\", :warn\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:processing_failed\" => \"true\"}\n ensure\n # No matter what we flag the file as processed and delete the temp copied file.\n @s.execute_post @s.url_for(\"p/#{id}\"), {\"sakai:needsprocessing\" => \"false\"}\n FileUtils.rm_f DOCS_DIR + \"/#{filename}\"\n end\n end\n\n FileUtils.remove_dir PDFS_DIR\n FileUtils.remove_dir PREV_DIR\n FileUtils.remove_dir DOCS_DIR\nend", "def main\n\n feedlist = File.foreach('parselist') do |wholeline|\n\n wholeline.strip!\n\n next if wholeline.empty?\n\n line = wholeline.split(\",\")\n url = line[0].strip\n tag = line[1].strip\n\n #parse each feed\n\n rss = SimpleRSS.parse(open(url).read)\n\n puts ' '\n puts rss.feed.title\n puts ' '\n\n rss.items[0..2].each do|i|\n puts \"Date: #{i.pubDate or i.published}\"\n puts \"Title: #{i.title}\"\n puts \"Link: #{i.link}\"\n puts \"=\" * 80\n end\n\n end\n\nend", "def main\n\tatts = Hash.new\n\tdata_hash = Hash.new\n\tanswer = nil\n\treading_data = false\n\n\t# Reading the input\n\tloop do\n\t\tline = $stdin.readline.chomp\n\t\tsplitted = line.split ' '\n\n\t\tif splitted[0] != '%' and !splitted[0].nil?\t\t# If it's not a comment\n\n\t\t\tif splitted[0].casecmp(\"@attribute\") == 0\n\t\t\t\tprev = answer\n\t\t\t\tvalues = splitted[2..-1].join.gsub(/[{}]/, '').split(',')\n\t\t\t\tanswer = {splitted[1] => values}\n\t\t\t\tatts.merge!(prev) if !prev.nil?\n\n\t\t\telsif splitted[0].casecmp(\"@data\") == 0\n\t\t\t\treading_data = true\n\n\t\t\telsif reading_data\n\t\t\t\tdata = splitted[0].split ','\n\t\t\t\tdata_hash.merge!({data[0..-2] => data[-1]})\n\n\t\t\tend\n\t\t\t\t\t\t\t\t\t\n\t\tend\n\t\tbreak if $stdin.eof?\n\tend\n\n\t# print atts.inspect\n\t# puts \"\"\n\t# print answer\n\t# puts \"\"\n\t# print data_hash\n\t# puts \"\"\n\n\ttotal_entropy = entropy(answer, data_hash)\n\n\tsplit(atts, data_hash, total_entropy, answer, [], 0)\t\n\nend", "def run(animals) # adding the run word to the dictionary metaphorically\n puts \"Welcome to the Pet Shop!!!\"\n puts \"Please make a selection:\"\n puts \"1. View a list of all animal names\"\n puts \"2. View all cats\" # view all cat names, not all cat instances\n puts \"3. Search for an animal by name\"\n choice = gets.chomp # remove whitespace and newlines ie \"1\\n\" vs \"1\"\n \n if choice == \"1\"\n puts animals.map do |animal| #use do/end for multiline blocks, {} for single line\n puts \"saw #{animal[:name]}\"\n animal[:name]\n end\n # YOU CANNNN DO THIS WITH EACH BUT MAP/COLLECT IS BETTER\n # just_names = []\n # all_animals.each { |ele| just_names << ele[:name]}\n # just_names\n elsif choice == \"2\" \n puts animals.filter { |animal| animal[:species] == \"cat\" } # an array of cat hashes\n # chaining enumberables! \n # puts animals.filter { |animal| animal[:species] == \"cat\" }.map { |cat| cat[:name]} # change this to print a list of cat names\n elsif choice == \"3\"\n puts \"What is the animal's name?\"\n search = gets.chomp\n puts animals.find { |ani| ani[:name] == search }\n else\n puts \"Give me a valid choice please!\"\n run(animals)\n end\n\n # binding.pry # to stop me to inspect animals, choice etc\nend", "def main(cmlInput)\n\temaillist,finalPrint = [],[]\n\temailXML = \"emails.xml\"\n\targm = nil\n\n\thelp(cmlInput.index(\"help\"))\n\t\n\targm = cmlInput.index(\"-xml\")\n\temailXML = cmlInput[argm+1] if argm != nil\n\n\temaillist = openFile(emaillist,emailXML)\n\n\targm = cmlInput.index(\"list\")\n\tif(argm)\n\t\temaillist.each {|e| finalPrint.push(e.toJson) if e.ip_address.eql? \n\t\t\tcmlInput[argm+2]} if cmlInput[argm+1].eql? \"--ip\" \n\t\t\n\t\temaillist.each {|e| finalPrint.push(e.toJson) if \n\t\t\te.first_name.downcase.include? cmlInput[argm+2].downcase or \n\t\t\te.last_name.downcase.include? cmlInput[argm+2].downcase} if \n\t\t\tcmlInput[argm+1].eql? \"--name\" \n\t\t\n\t\temaillist.each {|e| finalPrint.push(e.toJson) if\n\t\t\te.email.eql? cmlInput[argm+2]} if cmlInput[argm+1].eql? \"--email\" \n\tend\n\tputs jsonFinal(finalPrint)\nend", "def main\n #TODO: open in binary mode for Windows\n map_file = File.open(ARGV[0])\n map = load_map_file(map_file)\n log_file = File.new(ARGV[1])\n translate_log_file(map, log_file)\nend", "def create_new_entry()\n\tputs \"You are adding a new entry.\"\n\tentry = {}\n\tputs \"First name:\"\n\tentry[:first_name] = gets().chomp\n\tputs \"Last name:\"\n\tentry[:last_name] = gets().chomp\n\tputs \"Phone number:\"\n\tentry[:phone_number] = gets().chomp\n\tputs \"Email:\"\n\tentry[:email] = gets().chomp\n\t# entry.each do |entry_field, value|\n\t# \tputs \"Enter the person's #{entry_field}:\"\n\t# \tvalue = gets.chomp\n\t# \tputs entry.inspect\n\t# \tputs \"---\"\n\t# end\n\tentry_name = entry[:last_name] + \", \" + entry[:first_name]\n\tAddr_book[entry_name] = entry\n\tputs Addr_book.inspect\n\t# Exit workflow and return to main menu.\nend", "def wrap_entry(entry_name, content); end", "def test_basic_progname_filter\n processor_ = ::Sawmill::EntryProcessor::build do\n If(FilterByBasicFields(:progname => 'rails'), @entries)\n end\n @logger = ::Sawmill::Logger.new(:processor => processor_)\n @logger.info('Hello 1')\n @logger.info('rails') {'Hello 2'}\n @logger.info('Hello 3')\n assert_equal('Hello 2', @entries.dequeue.message)\n assert_equal(0, @entries.size)\n end" ]
[ "0.70323396", "0.6874803", "0.6874803", "0.6874803", "0.6874803", "0.6866741", "0.6630906", "0.6250296", "0.62387204", "0.62174827", "0.62174827", "0.62174827", "0.62174827", "0.6196818", "0.61786914", "0.6147069", "0.6114427", "0.60086113", "0.59967196", "0.59581983", "0.5894154", "0.5875353", "0.5850123", "0.58366925", "0.57970697", "0.5781912", "0.57720274", "0.568716", "0.5665754", "0.5639548", "0.5610058", "0.55873173", "0.55836564", "0.5575641", "0.55714947", "0.55552495", "0.55402875", "0.5535933", "0.5529904", "0.55272824", "0.55215263", "0.5517276", "0.5517276", "0.5517276", "0.5517276", "0.5517276", "0.5517276", "0.5517276", "0.5517276", "0.5516842", "0.5503742", "0.55005926", "0.5496661", "0.5461974", "0.54494345", "0.54437345", "0.5429249", "0.5415835", "0.54108477", "0.54083496", "0.54059243", "0.5398905", "0.53944695", "0.53861785", "0.5385294", "0.5381116", "0.5380808", "0.53626746", "0.5352702", "0.53518236", "0.533906", "0.53388864", "0.5329225", "0.5326593", "0.53221947", "0.5319804", "0.53193736", "0.5317567", "0.5316177", "0.5315309", "0.5306242", "0.53059083", "0.53027934", "0.5300873", "0.53007555", "0.5292981", "0.52923924", "0.52881706", "0.528687", "0.5278383", "0.5277687", "0.5275001", "0.5274255", "0.527034", "0.5264684", "0.52626675", "0.5261699", "0.5258152", "0.52503085", "0.5247625" ]
0.61355317
16
Get required output from OpenBabel conversion operation
def obabelOutput(name, smiles) insert = %Q_> <id>\n#{smiles}\n\n> <Name>\n#{name}\n\n$$$$_ response = %x_obabel -:"#{smiles}" -osdf --gen2D_.rstrip.split(/\n/) response[-1] = insert return response.join("\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output\n return @output if @output\n\n convert!\n @output\n end", "def convert(output, args={})\n tokens = [\"convert\"]\n tokens << convert_to_arguments(args) if args\n tokens << \" '#{@file}#{\"[#{args[:layer].to_s}]\" if args[:layer]}'\"\n tokens << \" -annotate #{args[:annotate].to_s}\" if args[:annotate]\n tokens << \" #{output}\"\n tokens = convert_to_command(tokens)\n success = run(tokens)[1]\n success\n end", "def convert!; end", "def converter; end", "def convert\n end", "def convert\n end", "def test_example(output_exmpl, input_exmpl)\n converted_exmpl = output_suite.convert_example(input_exmpl, output_exmpl.opts, renderer)\n msg = output_exmpl.desc.presence || input_exmpl.desc\n\n assert_equal output_exmpl, converted_exmpl, msg\n end", "def result(output)\n output\n end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def output=(_arg0); end", "def convert()\n xml_to_html()\n html_to_pandoc()\n\n\n if @option[:file_output] == \"\"\n # Without -o option\n puts @result\n else\n # Using option: -o filename\n File.open(@option[:file_output],\"w\") do |f|\n f.write(@result)\n end\n end\n\n return @result\n end", "def output_ext\n converter.output_ext(self.ext)\n end", "def alb_convert data_type, target, model_script=nil\n case data_type \n when 'ltspice'\n cdraw2target target, 'cdraw', File.expand_path(target), model_script\n if target == 'qucs'\n Dir.chdir('qucs'){\n qucs2alb_back\n }\n elsif target == 'eeschema'\n Dir.chdir('eeschema'){\n eeschema2alb_back\n }\n elsif target == 'xschem'\n Dir.chdir('xschem'){\n xschem2alb_back\n }\n end\n when 'eeschema'\n alb2eeschema 'cdraw', File.expand_path('eeschema')\n if target == 'qucs'\n eeschema2qucs 'eeschema', File.expand_path('qucs')\n Dir.chdir('qucs'){\n qucs2alb_back\n }\n elsif target == 'xschem'\n eeschema2xschem 'eeschema', File.expand_path('xschem')\n Dir.chdir('xschem'){\n xschem2alb_back\n }\n elsif target == 'ltspice'\n eeschema2cdraw 'eeschema', File.expand_path('alta')\n Dir.chdir('alta'){\n cdraw2alb_back\n }\n end\n when 'xschem'\n if target == 'qucs'\n xschem2qucs 'cdraw', File.expand_path('qucs')\n elsif target == 'xschem'\n alb2xschem 'cdraw', File.expand_path('xschem')\n elsif target == 'eeschema'\n xschem2eeschema 'cdraw', File.expand_path('eeschema')\n elsif target == 'ltspice'\n alb2xschem 'cdraw', File.expand_path('xschem')\n xschem2cdraw 'xschem', File.expand_path('alta')\n Dir.chdir('alta'){\n cdraw2alb_back\n }\n end\n when 'qucs'\n if target == 'qucs'\n alb2qucs 'cdraw', File.expand_path('qucs'), model_script\n elsif target == 'eeschema'\n qucs2eeschema 'cdraw', File.expand_path('qucs'), model_script\n elsif target == 'xschem'\n qucs2xschem 'cdraw', File.expand_path('qucs'), model_script\n elsif target == 'ltspice'\n qucs2cdraw nil, self.project.name, File.expand_path('alta')\n Dir.chdir('alta'){\n cdraw2alb_back\n }\n end\n end\n end", "def convert!\n @output = convert\n self\n end", "def output\n output = super\n output_loopback(output)\n output_stubs(output)\n output\n end", "def convert_binary\n end", "def converter\n end", "def convert\n @input\n end", "def get_conversion_info\n # body = {\n # cmd: \"get_conversion_info\"\n # }\n\n end", "def convert(data=nil)\n @input = data if data\n @output = @input\n @output\n end", "def convert_one(*args)\n raise \"x2t file is not found in #{@bin_path} path\" unless x2t_exist?\n output_file_path = \"#{@convert_to}/#{File.basename(args.first[:input_file], '.*')}.\" + args.first[:format_to]\n convert_file(args.first[:input_file], output_file_path, false)\n output_file_path\n end", "def convert(*inputs, output) # Define commands as a method.\n prompt = TTY::Prompt.new(interrupt: :exit)\n items = Conv.new.find_item(inputs, output, input_format=input_format, output_format=output_format, package_manager: options[:package_manager])\n candidate = items[0]\n if items.empty?\n prompt.error \"No candidates.\"\n inputs << output\n list(*inputs) if !options[:hidelist]\n else\n if options[:confirm]#interactive]\n candidate = prompt.select(\"Choose commands (To cancel, press CTRL+C)\", items) #do |item|\n end\n prompt.ok candidate.cmd(inputs, output) unless options[:quiet]\n return if !options[:overwrite] && !ask_overwrite(output) || options[:dryrun]\n status, stdout, stderr = candidate.run!(inputs, output, options[:arguments])\n prompt.ok stdout\n prompt.error stderr\n if status != 0\n if options[:autobrew] || !prompt.no?(\"Install \" + candidate.package + \" with package manager? (\" + candidate.brew_command + \")\")\n status, stdout, stderr = candidate.brew!\n prompt.say stdout\n prompt.error stderr\n if status == 0\n status, stdout, stderr = candidate.run!(inputs, output)\n prompt.ok stdout\n prompt.error stderr\n end\n end\n else\n Conv.update!(candidate) unless options[:onetime]\n end\n end\n end", "def converters; end", "def converters; end", "def converters; end", "def converters=(_arg0); end", "def compilereturn\n\n end", "def outV\n self.source\n end", "def output\n return @output || @run_step.output\n end", "def k_conversion!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n\n\n type = K_CONVERSION\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 377:4: ( 'STRING' | 'INT' | 'FLOAT' | 'VAR' | 'TIME' | 'DATE' )\n # at line 377:4: ( 'STRING' | 'INT' | 'FLOAT' | 'VAR' | 'TIME' | 'DATE' )\n alt_6 = 6\n case look_6 = @input.peek( 1 )\n when 0x53 then alt_6 = 1\n when 0x49 then alt_6 = 2\n when 0x46 then alt_6 = 3\n when 0x56 then alt_6 = 4\n when 0x54 then alt_6 = 5\n when 0x44 then alt_6 = 6\n else\n raise NoViableAlternative( \"\", 6, 0 )\n\n end\n case alt_6\n when 1\n # at line 377:5: 'STRING'\n match( \"STRING\" )\n\n\n when 2\n # at line 377:14: 'INT'\n match( \"INT\" )\n\n\n when 3\n # at line 377:20: 'FLOAT'\n match( \"FLOAT\" )\n\n\n when 4\n # at line 377:28: 'VAR'\n match( \"VAR\" )\n\n\n when 5\n # at line 377:34: 'TIME'\n match( \"TIME\" )\n\n\n when 6\n # at line 377:41: 'DATE'\n match( \"DATE\" )\n\n\n end\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n\n end", "def outputPolynomialConversions()\n isFirst = true\n\n # Step through each row in the table\n for row in 0..$numStructRows - 1\n # Get the polynomial coefficients for this row\n polynomialCoefficients = ccdd.getStructureTableData(\"polynomial coefficients\", row)\n\n # Check if the parameter has polynomial coefficients\n if polynomialCoefficients != nil && !polynomialCoefficients.empty?\n # Check if this is the first polynomial conversion\n if isFirst\n # Write the polynomial conversion header to the file\n ccdd.writeToFileLn($tlmFile, \"\")\n ccdd.writeToFileLn($tlmFile, \"/* Polynomial Conversions -- a list of constants {a0,a1,a2,,,an} , where y= a0 + a1*x + a2*x^2 + ... an*x^n */\")\n isFirst = false\n end\n\n # Output the polynomial conversion for this row in the data table\n outputPolynomialConversion(row, polynomialCoefficients)\n end\n end\nend", "def output_buffer=(_arg0); end", "def output_buffer=(_arg0); end", "def assemble(op)\n dump = \"\"\n Tempfile.open(['getopcode','.o']) do |f|\n `echo '#{op}' | #{$as} #{$flags} -o #{f.path}`\n dump = `#{$objdump} -d #{f.path}`\n end\n\n unless $xmos \n return extract_opcode(dump)\n else\n return xmos_extract_opcode(dump)\n end\nend", "def output\n return basic_output()\n end", "def to_proc() end", "def to_proc() end", "def to_io() end", "def output_ext; end", "def output_ext; end", "def output_ext; end", "def convert\n raise NotImplementedError\n end", "def getResult\n return @out\n end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def output; end", "def convert_to_binary\n @input.class == String ? @input : @input.to_s(2)\n end", "def out; end", "def converter\n\n end", "def convert(object); end", "def output\n @output ||= Output.new\n end", "def transformation\n end", "def convert\n # TODO: implementation\n output_file = choose_output\n return if output_file.nil?\n Converter.translate(@file, output_file)\n log(\"File conversion finished\")\n end", "def output\n @output.map(&:to_s)\n end", "def get_output\n\t\tout = @outputs[@cnt1].to_s.split(\"=\")[1]\n\t\t# >>> Calculate Output expression\n=begin\n\t\texp = out.to_s.scan(/!\\(.*?\\).*/).to_s.slice(1..-1) + \"\\'\" if out.slice(0..1) == \"!(\"\n\n\t\texp.scan(/!\\(.*?\\)/).each do |e|\n\t\t\texp = exp.gsub(e.to_s, (e.to_s.slice(1..-1)+\"\\'\" ) )\n\t\tend\n\n\n=end\n\t\treturn (out.nil?) ? \"0\" : out\n\tend", "def startBCLToFastQConversion()\n cmd = \"ruby \" + PathInfo::BIN_DIR + \"/BclToFastQConvertor.rb \" +\n \"fcname=\" + @fcName.to_s\n output = `#{cmd}`\n end", "def convert\n self.convert!\n ss = system(convert_command)\n if ss && $?.exitstatus == 0\n self.converted!\n else\n self.failed!\n end\n end", "def render_as_format(from, to, format)\n puts \"Hola, bon dia!!\"\n puts from\n puts to\n thefile = `iconv -f ISO8859-1 #{from}`\n dotfile = Tempfile.new('dot')\n begin\n model = T2Flow::Parser.new.parse(thefile)\n T2Flow::Dot.new.write_dot(dotfile, model)\n dotfile.close\n `dot -T#{format} -o\"#{to}\" #{dotfile.path}`\n ensure\n dotfile.unlink\n end\nend", "def get_output(job_data)\n result = \"\"\n make_call(NO_TIMEOUT, false) { \n result = conn.neptune_get_output(job_data, @secret)\n } \n abort(result) if result =~ /Error:/\n return result\n end", "def output\n self.class.output\n end", "def to_s() @out.to_s end", "def convert _node, _name = nil, _opts = {}\n \"Well done: You plugged in a converter backend named 'backend_tpl'\"\n end", "def output\n @all[:output]\n end", "def convert\n self.convert!\n success = system(convert_command)\n if success && $?.exitstatus == 0\n self.converted!\n else\n self.failure!\n end\n end", "def internal_convert(\n input, convert_logger, backend, standalone, extra_attributes\n )\n attributes = { 'docdir' => File.dirname(__FILE__) }\n attributes.merge! extra_attributes\n args = internal_convert_args convert_logger, backend, standalone, attributes\n Asciidoctor.convert input, args\nend", "def output\n @output ||= begin\n with_buffer_pointer do |buf|\n LibTidy.tidySaveBuffer(@doc, buf)\n buf[:bp]\n end\n end\n end", "def call_conv\n C.LLVMGetInstructionCallConv(self)\n end", "def output_ext\n end", "def output\n @output\n end", "def convert(exp)\n if exp == nil\n {}\n elsif exp == false\n {\n :type => :name,\n :id => 'false',\n }\n elsif exp == true\n {\n :type => :name,\n :id => 'true',\n }\n else\n case exp[0]\n when :program\n {\n :type => :program,\n :body => convert(exp[1]),\n :filename => @filename\n }\n when :module\n {\n :type => :module,\n :name => convert(exp[1]),\n :body => convert(exp[2]),\n :filename => @filename\n }\n when :@ident, :@op\n {\n :type => :name,\n :id => exp[1],\n :location => exp[2],\n }\n when :@gvar\n {\n :type => :gvar,\n :id => exp[1],\n :location => exp[2]\n }\n when :dyna_symbol\n # ignore dynamic symbols for now\n {\n :type => :name,\n :id => '#dyna_symbol'\n }\n when :symbol\n sym = convert(exp[1])\n sym[:type] = :symbol\n sym\n when :@cvar\n {\n :type => :cvar,\n :id => exp[1][2..-1],\n :location => exp[2]\n }\n when :@ivar\n {\n :type => :ivar,\n :id => exp[1][1..-1],\n :location => exp[2]\n }\n when :@const, :@kw, :@backtick\n #:@const and :@kw are just names\n {\n :type => :name,\n :id => exp[1],\n :location => exp[2]\n }\n when :@label\n {\n :type => :name,\n :id => exp[1][0..-2],\n :location => exp[2]\n }\n when :def\n {\n :type => :def,\n :name => convert(exp[1]),\n :params => convert(exp[2]),\n :body => convert(exp[3])\n }\n when :defs\n name = {\n :type => :attribute,\n :value => convert(exp[1]),\n :attr => convert(exp[3])\n }\n {\n :type => :def,\n :name => name,\n :params => convert(exp[4]),\n :body => convert(exp[5])\n }\n when :do_block\n {\n :type => :lambda,\n :params => convert(exp[1]),\n :body => convert(exp[2])\n }\n when :lambda\n {\n :type => :lambda,\n :params => convert(exp[1]),\n :body => convert(exp[2])\n }\n when :brace_block\n {\n :type => :lambda,\n :params => convert(exp[1]),\n :body => convert(exp[2])\n }\n when :params\n ret = {:type => :params}\n if exp[1]\n ret[:positional] = convert_array(exp[1])\n end\n if exp[2]\n # keyword arguments (converted into positionals and defaults)\n unless ret[:positional]\n ret[:positional] = []\n end\n exp[2].each { |x| ret[:positional].push(convert(x[0])) }\n ret[:defaults] = exp[2].map { |x| convert(x[1]) }\n end\n if exp[3] and exp[3] != 0\n ret[:rest] = convert(exp[3])\n end\n if exp[4]\n ret[:after_rest] = convert_array(exp[4])\n end\n if exp[5]\n ret[:kw_keys] = convert_array(exp[5].map{ |x| x[0]})\n ret[:kw_values] = convert_array(exp[5].map{ |x| x[1] })\n end\n if exp[6]\n ret[:rest_kw] = convert(exp[6])\n end\n if exp[7]\n ret[:blockarg] = convert(exp[7])\n end\n ret\n when :block_var\n params = convert(exp[1])\n if exp[2]\n params[:block_var] = convert_array(exp[2])\n end\n params\n when :class\n ret = {\n :type => :class,\n :static => false,\n :name => convert(exp[1]),\n :body => convert(exp[3]),\n }\n if exp[2]\n ret[:super] = convert(exp[2])\n end\n ret\n when :sclass\n {\n :type => :class,\n :static => true,\n :name => convert(exp[1]),\n :body => convert(exp[2]),\n }\n when :method_add_block\n call = convert(exp[1])\n if call[:args]\n call[:args][:blockarg] = convert(exp[2])\n else\n call[:args] = {\n :blockarg => convert(exp[2])\n }\n end\n call\n when :method_add_arg\n call = convert(exp[1])\n call[:args] = convert(exp[2])\n call\n when :vcall\n {\n :type => :call,\n :func => convert(exp[1])\n }\n when :command\n {\n :type => :call,\n :func => convert(exp[1]),\n :args => convert(exp[2])\n }\n when :command_call\n if exp[2] == :'.' or exp[2] == :'::'\n func = {\n :type => :attribute,\n :value => convert(exp[1]),\n :attr => convert(exp[3])\n }\n else\n func = convert(exp[1])\n end\n {\n :type => :call,\n :func => func,\n :args => convert(exp[4])\n }\n when :super, :zsuper\n {\n :type => :call,\n :func => {:type => :name, :id => :super},\n :args => convert(exp[1])\n }\n when :call, :fcall\n if exp[3] != :call and (exp[2] == :'.' or exp[2] == :'::')\n func = {\n :type => :attribute,\n :value => convert(exp[1]),\n :attr => convert(exp[3])\n }\n else\n func = convert(exp[1])\n end\n {\n :type => :call,\n :func => func\n }\n when :args_new, :mlhs_new, :mrhs_new, :words_new, :word_new, :qwords_new, :qsymbols_new, :symbols_new\n {\n :type => :args,\n :positional => []\n }\n when :args_add, :mlhs_add, :mrhs_add, :word_add, :words_add, :qwords_add, :qsymbols_add, :symbols_add\n args = convert(exp[1])\n args[:positional].push(convert(exp[2]))\n args\n when :args_add_star, :mrhs_add_star, :mlhs_add_star\n args = convert(exp[1])\n if exp[2]\n args[:star] = convert(exp[2])\n end\n args\n when :args_add_block\n args = convert(exp[1])\n if exp[2]\n args[:blockarg] = convert(exp[2])\n end\n args\n when :assign, :massign\n {\n :type => :assign,\n :target => convert(exp[1]),\n :value => convert(exp[2])\n }\n when :opassign\n # convert x+=1 into x=x+1\n operation = convert([:binary, exp[1], exp[2][1][0..-2], exp[3]])\n {\n :type => :assign,\n :target => convert(exp[1]),\n :value => operation\n }\n when :dot2, :dot3\n {\n :type => exp[0],\n :from => convert(exp[1]),\n :to => convert(exp[2])\n }\n when :alias, :var_alias\n {\n :type => :assign,\n :target => convert(exp[1]),\n :value => convert(exp[2])\n }\n when :undef\n {\n :type => :undef,\n :names => convert_array(exp[1]),\n }\n when :if, :if_mod, :elsif, :ifop\n ret = {\n :type => :if,\n :test => convert(exp[1]),\n :body => convert(exp[2]),\n }\n if exp[3]\n ret[:else] = convert(exp[3])\n end\n if exp[0] == :if_mod\n ret[:mod] = true\n end\n ret\n when :case\n if exp[1]\n value = convert(exp[1])\n else\n value = nil\n end\n convert_when(exp[2], value)\n when :while, :while_mod\n if exp[0] == :while_mod\n mod = true\n else\n mod = false\n end\n {\n :type => :while,\n :test => convert(exp[1]),\n :body => convert(exp[2]),\n :mod => mod\n }\n when :until, :until_mod\n if exp[0] == :until_mod\n mod = true\n else\n mod = false\n end\n {\n :type => :while,\n :test => negate(convert(exp[1])),\n :body => convert(exp[2]),\n :mod => mod\n }\n when :unless, :unless_mod\n if exp[0] == :unless_mod\n mod = true\n else\n mod = false\n end\n ret = {\n :type => :if,\n :test => negate(convert(exp[1])),\n :body => convert(exp[2]),\n :mod => mod\n }\n if exp[3]\n ret[:else] = convert(exp[3])\n end\n ret\n when :for\n {\n :type => :for,\n :target => convert(exp[1]),\n :iter => convert(exp[2]),\n :body => convert(exp[3])\n }\n when :begin\n bodystmt = exp[1]\n {\n :type => :begin,\n :body => convert(bodystmt[1]),\n :rescue => convert(bodystmt[2]),\n :else => convert(bodystmt[3]),\n :ensure => convert(bodystmt[4])\n }\n when :rescue\n ret = {:type => :rescue}\n if exp[1]\n if exp[1][0].is_a? Array\n ret[:exceptions] = convert_array(exp[1])\n else\n ret[:expections] = convert(exp[1])[:positional]\n end\n end\n if exp[2]\n ret[:binder] = convert(exp[2])\n end\n if exp[3]\n ret[:handler] = convert(exp[3])\n end\n if exp[4]\n ret[:else] = convert(exp[4])\n end\n ret\n when :rescue_mod\n {\n :type => :begin,\n :body => convert(exp[1]),\n :rescue => convert(exp[2]),\n :mod => true\n }\n when :stmts_new\n {\n :type => :block,\n :stmts => []\n }\n when :stmts_add\n block = convert(exp[1])\n stmt = convert(exp[2])\n block[:stmts].push(stmt)\n block\n when :bodystmt\n block = convert(exp[1])\n if exp[2]\n res = convert(exp[2])\n block[:stmts].push(res)\n end\n block\n when :binary\n {\n :type => :binary,\n :left => convert(exp[1]),\n :op => op(exp[2]),\n :right => convert(exp[3])\n }\n when :array\n args = convert(exp[1])\n {\n :type => :array,\n :elts => args[:positional]\n }\n when :aref, :aref_field\n args = convert(exp[2])\n {\n :type => :subscript,\n :value => convert(exp[1]),\n :slice => args[:positional]\n }\n when :unary\n {\n :type => :unary,\n :op => op(exp[1]),\n :operand => convert(exp[2])\n }\n when :@int\n {\n :type => :int,\n :value => exp[1],\n :location => exp[2]\n }\n when :@float\n {\n :type => :float,\n :value => exp[1],\n :location => exp[2]\n }\n when :regexp_literal\n regexp = convert(exp[1])\n regexp[:regexp_end] = convert(exp[2])\n regexp\n when :regexp_new\n {\n :type => :regexp,\n }\n when :regexp_add\n {\n :type => :regexp,\n :pattern => convert(exp[2]),\n }\n when :@regexp_end\n make_string(exp[1], exp[2])\n when :@backref\n make_string(exp[1], exp[2])\n when :@tstring_content, :@CHAR\n make_string(exp[1], exp[2])\n when :string_content, :xstring_new\n make_string('')\n when :string_add, :xstring_add, :qwords_add\n if not exp[1] or exp[1] == [:string_content] or exp[1] == [:xstring_new]\n convert(exp[2])\n else\n {\n :type => :binary,\n :op => op(:+),\n :left => convert(exp[1]),\n :right => convert(exp[2])\n }\n end\n when :string_concat, :xstring_concat\n convert([:binary, exp[1], :+, exp[2]])\n when :hash\n if exp[1]\n convert(exp[1])\n else\n {\n :type => :hash,\n }\n end\n when :assoclist_from_args, :bare_assoc_hash\n {\n :type => :hash,\n :entries => convert_array(exp[1])\n }\n when :assoc_new\n {\n :type => :assoc,\n :key => convert(exp[1]),\n :value => convert(exp[2])\n }\n when :const_path_ref, :const_path_field\n {\n :type => :attribute,\n :value => convert(exp[1]),\n :attr => convert(exp[2])\n }\n when :field\n {\n :type => :attribute,\n :value => convert(exp[1]),\n :attr => convert(exp[3])\n }\n when :void_stmt\n {\n :type => :void\n }\n when :yield0\n {\n :type => :yield\n }\n when :return0\n {\n :type => :return\n }\n when :break\n {\n :type => :break\n }\n when :retry\n {\n :type => :retry\n }\n when :redo\n {\n :type => :redo\n }\n when :defined\n {\n :type => :unary,\n :op => op(:defined),\n :operand => convert(exp[1])\n }\n when :return, :yield\n {\n :type => exp[0],\n :value => args_to_array(convert(exp[1]))\n }\n when :string_embexpr\n {\n :type => :string_embexpr,\n :value => convert(exp[1])\n }\n when :var_ref,\n :var_field,\n :const_ref,\n :top_const_ref,\n :top_const_field,\n :paren,\n :else,\n :ensure,\n :arg_paren,\n :mlhs_paren,\n :rest_param,\n :blockarg,\n :symbol_literal,\n :regexp_literal,\n :param_error,\n :string_literal,\n :xstring_literal,\n :string_dvar,\n :mrhs_new_from_args,\n :assoc_splat,\n :next,\n :END,\n :BEGIN\n # superflous wrappers that contains one object, just remove it\n convert(exp[1])\n else\n banner('unknown')\n puts \"#{exp}\"\n exp\n end\n end\n end", "def read_output()\n if outputs.size > 0\n outputs.shift\n else\n nil\n end\n end", "def ast; end", "def ast; end", "def to_sxp_bin\n [:ShapeResult, shape, result, expression].map(&:to_sxp_bin)\n end", "def link_outputs(task_full_name)\n <<~CODE\n python <<EOF\n import json\n import subprocess\n import re\n\n def sh(cmd, ignore_error=False):\n try:\n print cmd\n subprocess.check_call(cmd, shell=True)\n except subprocess.CalledProcessError as e:\n sys.exit(e.returncode)\n\n with open(\"#{CROMWELL_OUTPUTS_FILE}\") as f:\n cwloutputs = json.loads(f.read())['outputs']\n\n for oname, ovalue in cwloutputs.items():\n if ovalue is not None:\n sh(\"emit {} {}\".format(re.sub(\"#{task_full_name}.\", \"\", oname), ovalue))\n EOF\n CODE\n end", "def get_opml_export\n OpmlExporter.get_export self\n end", "def conversion_variable\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n\n return_value = ConversionVariableReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n __K_CONVERSION72__ = nil\n __LPAR73__ = nil\n __Identificador74__ = nil\n __RPAR76__ = nil\n __EOL77__ = nil\n var_local75 = nil\n\n\n tree_for_K_CONVERSION72 = nil\n tree_for_LPAR73 = nil\n tree_for_Identificador74 = nil\n tree_for_RPAR76 = nil\n tree_for_EOL77 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 91:4: K_CONVERSION LPAR ( Identificador | var_local ) RPAR EOL\n __K_CONVERSION72__ = match( K_CONVERSION, TOKENS_FOLLOWING_K_CONVERSION_IN_conversion_variable_379 )\n if @state.backtracking == 0\n tree_for_K_CONVERSION72 = @adaptor.create_with_payload( __K_CONVERSION72__ )\n @adaptor.add_child( root_0, tree_for_K_CONVERSION72 )\n\n end\n\n __LPAR73__ = match( LPAR, TOKENS_FOLLOWING_LPAR_IN_conversion_variable_381 )\n if @state.backtracking == 0\n tree_for_LPAR73 = @adaptor.create_with_payload( __LPAR73__ )\n @adaptor.add_child( root_0, tree_for_LPAR73 )\n\n end\n\n # at line 91:22: ( Identificador | var_local )\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == Identificador )\n alt_9 = 1\n elsif ( look_9_0 == DOUBLEDOT )\n alt_9 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n\n raise NoViableAlternative( \"\", 9, 0 )\n\n end\n case alt_9\n when 1\n # at line 91:23: Identificador\n __Identificador74__ = match( Identificador, TOKENS_FOLLOWING_Identificador_IN_conversion_variable_384 )\n if @state.backtracking == 0\n tree_for_Identificador74 = @adaptor.create_with_payload( __Identificador74__ )\n @adaptor.add_child( root_0, tree_for_Identificador74 )\n\n end\n\n\n when 2\n # at line 91:37: var_local\n @state.following.push( TOKENS_FOLLOWING_var_local_IN_conversion_variable_386 )\n var_local75 = var_local\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, var_local75.tree )\n end\n\n\n end\n __RPAR76__ = match( RPAR, TOKENS_FOLLOWING_RPAR_IN_conversion_variable_389 )\n if @state.backtracking == 0\n tree_for_RPAR76 = @adaptor.create_with_payload( __RPAR76__ )\n @adaptor.add_child( root_0, tree_for_RPAR76 )\n\n end\n\n __EOL77__ = match( EOL, TOKENS_FOLLOWING_EOL_IN_conversion_variable_391 )\n if @state.backtracking == 0\n tree_for_EOL77 = @adaptor.create_with_payload( __EOL77__ )\n @adaptor.add_child( root_0, tree_for_EOL77 )\n\n end\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n if @state.backtracking == 0\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n\n end\n\n return return_value\n end", "def ConvertA2X\n # a2x options\n if not @FullOpts.nil?\n opts = @FullOpts + \" \"\n else\n opts = self.getOptionsA2X()\n end\n\n opts += @Opts + \" \" if not @Opts.nil?\n\n opts += \"-v \" if $debug2\n \n # Execute pre actions\n self.ExecuteAction(:pre)\n \n cmd = \"a2x -D #{@outdir} #{opts} #{@doc.filename}\"\n puts \"Generating (#{@Type}) #{@outfile}\\n\"\n puts \"Executing : #{cmd}\" if $verbose\n res = %x[#{cmd}]\n puts res if res != \"\"\n \n if $? == 0\n # Execute post actions\n self.ExecuteAction(:post)\n end\n\n end" ]
[ "0.60510087", "0.5810248", "0.5746399", "0.5596033", "0.5486675", "0.5486675", "0.54468", "0.5444783", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.53817195", "0.5377914", "0.53620195", "0.53517306", "0.53185314", "0.53182846", "0.5269896", "0.5268052", "0.5263209", "0.52564245", "0.523843", "0.5199411", "0.51907724", "0.51848125", "0.51848125", "0.51848125", "0.51791275", "0.51621354", "0.51574594", "0.51569396", "0.514706", "0.5059422", "0.503534", "0.503534", "0.5023485", "0.5019165", "0.5018709", "0.5018709", "0.5010275", "0.500886", "0.500886", "0.500886", "0.5005506", "0.49955383", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.4993083", "0.49914595", "0.49861643", "0.49828315", "0.49796206", "0.4963507", "0.4960666", "0.49525398", "0.49448195", "0.4944411", "0.49252424", "0.4924654", "0.49244475", "0.49234623", "0.4914533", "0.49125433", "0.49084157", "0.49007782", "0.48918414", "0.48817486", "0.4869564", "0.48582783", "0.48555377", "0.48550615", "0.48544148", "0.48527575", "0.48518363", "0.48518363", "0.48429677", "0.4839207", "0.48332998", "0.48316482", "0.482446" ]
0.52790856
25
Set the "slimmer headers" to configure the page
def set_slimmer_headers(hash) raise InvalidHeader if (hash.keys - SLIMMER_HEADER_MAPPING.keys).any? SLIMMER_HEADER_MAPPING.each do |hash_key, header_suffix| value = hash[hash_key] headers["#{HEADER_PREFIX}-#{header_suffix}"] = value.to_s if value end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_headers! session = nil\n response.headers['sid'] = session.id\n response.headers['utoken'] = session.utoken\n end", "def add_headers; end", "def show_headers=(value)\n @show_headers = value\n end", "def on_header_init()\n end", "def kopal_layout_before_page_header\n\n end", "def page_header(site_config, page_count)\n # start common page region\n page = %(<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <!-- The above 3 meta tags *must* come first in the head;\n any other head content must come *after* these tags -->\n <title>#{site_config['title']}</title>)\n page += add_icons\n page += %(\n <meta name=\"description\" content=\"#{site_config['description']}\">\n <meta name=\"theme-color\" content=\"##{site_config['theme_color']}\">\n <link rel=\"stylesheet\" href=\"assets/bootstrap/css/bootstrap.min.css\">\n <link rel=\"stylesheet\" href=\"assets/bootstrap/css/bootstrap-theme.min.css\">\n <style>\n .container-fluid { padding: 0px; }\n .navbar, .navbar-default { margin-bottom: 0; padding: 5pt; background-color: ##{site_config['theme_color']}; font-size: 12pt; }\n .navbar, .navbar-default li a { color: ##{site_config['text_color']} !important; }\n .navbar-default .navbar-brand { margin-left: 20px !important; color: ##{site_config['logo_text_color']}; font-size: 18pt; font-weight: bold; }\n .navbar-brand:hover { background-color: #{site_config['nav_hover_color']} !important; }\n div[id^=\"d3pie_chart_div_\"], canvas { margin-bottom: 100px; }\n footer { background-color: ##{site_config['theme_color']}; min-height: 200px;}\n footer ul a { color: ##{site_config['text_color']} !important; font-size: 13pt; }\n footer .container { margin-left: 15px; }\n .built { text-decoration: none !important; }\n .selected { background-color: #{site_config['nav_selected_color']}; font-weight: bold; }\n .navbar-default li:hover a { background-color: #{site_config['nav_hover_color']} !important; }\n h1 { text-align: center; background-color: ##{site_config['theme_color']}; padding: 14px; color: ##{site_config['text_color']}; }\n pre { white-space: pre-wrap; word-wrap: break-word; }\n .homepage { padding: 5px 30px 5px 30px; }\n .logo { float: left; }\n .oll { padding-left: 1em; }\n h2#other { text-align: center; }\n .plotlypie { height: 625px; }\n </style>\n </head>\n <body>\n <!-- Static navbar -->\n <nav class=\"navbar navbar-default\" id=\"head1\">\n <div class=\"container-fluid\">\n <div class=\"navbar-header\">\n <a href=\"index.html\"><img src=\"assets/images/logo.png\" alt=\"Ruby Powered\" class=\"logo\"></a>\n <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n <a class=\"navbar-brand\" href=\"index.html\">#{site_config['nav_heading']}</a>\n </div>\n <div id=\"navbar\" class=\"navbar-collapse collapse\">\n <ul class=\"nav navbar-nav\">)\n page += add_links(page_count)\n page += %(\n </ul>\n </div>\n </div>\n </nav>\n <div class=\"container-fluid\">)\n (0..page_count).map do |i|\n instance_variable_set(\"@page#{ii(i)}\", page)\n end\nend", "def headers=(v)\n cfg_set(:headers, v)\n end", "def header\n end", "def headers\n end", "def header(routes); end", "def push_to_headers\n unless @session.nil?\n response.headers['sid'] = @session.id\n response.headers['utoken'] = @session.utoken\n end\n end", "def index(request, response)\n response['rack.rsi'] = '1'\n response['Cache-Control'] = 'max-age=3600'\n response.write(%{\n <title>HelloWorld</title>\n <%= rsi_include( \"/header?user=buzzmenot\" ) %>\n <p>Hello World!</p>\n <%= rsi_include( \"/footer?company=github\" ) %>\n }.gsub(/^\\s*/, \"\").strip)\n end", "def add_security_headers\n response.headers[\"X-Frame-Options\"] = \"SAMEORIGIN\"\n response.headers[\"X-XSS-Protection\"] = \"1; mode=block\"\n response.headers[\"X-Content-Type-Options\"] = \"nosniff\"\n end", "def set_response_headers\n response.set_header('Cache-Control', 'no-cache,no-store')\n response.set_header('Pragma', 'no-cache')\n response.set_header('Expires', 'Tue, 01 Jan 1980 00:00:00 GMT')\n response.set_header('Cross-Origin-Embedder-Policy', 'require-corp')\n response.set_header('Cross-Origin-Opener-Policy', 'same-origin')\n response.set_header('Cross-Origin-Resource-Policy', 'same-origin')\n end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def headers; end", "def header(routes)\n # no need for a header\n end", "def configure_defaults\n self.default_request_format = :html\n self.default_response_format = :html\n\n self.default_headers = {\n \"X-Frame-Options\" => \"DENY\",\n \"X-Content-Type-Options\" => \"nosniff\",\n \"X-XSS-Protection\" => \"1; mode=block\"\n }\n end", "def header(name, value)\n har_headers << [name, value]\n super(name, value)\n end", "def headers=(v)\n cfg_set(:headers, v)\n end", "def fill_header(response); end", "def header; end", "def header; end", "def header; end", "def setHeaders(headers)\n @headers = headers\n end", "def headers\n { 'Status' => ActionController::Base::DEFAULT_RENDER_STATUS_CODE }\n end", "def set_page\n end", "def header(routes)\n end", "def header\n @header ||= HeaderController.new config\n end", "def kopal_layout_after_page_header\n\n end", "def set_info\n @page_header = 'Insight Engine'\n @page_secondary = 'Let\\'s get a view at 10,000 feet.'\n @page_title = 'LeadAccount | Insight Engine'\n @page_icon = 'lightbulb'\n end", "def headers=(headers)\n @headers = headers.merge({\"User-Agent\" => user_agent})\n end", "def headers\n super\n @headers['User-Agent'] = \"Recurly Ruby Client v#{VERSION}\"\n @headers\n end", "def set_sasc_request_headers(api_version = nil)\n sasc_request_headers(api_version).each { |header, value| request.headers[header] = value }\n end", "def head\n HEADER\n end", "def set_pagination_headers\n headers[\"Access-Control-Expose-Headers\"] = \"Link, Page, Per-Page\"\n headers[\"Page\"] = current_page\n headers[\"Per-Page\"] = current_per_page\n end", "def set_site_header\n @site_header = SiteHeader.find(params[:id])\n end", "def get_header() \n erb :header\n end", "def head_main(options)\n options[:charset] ||= 'utf-8' \n \n # Prefix (leading space)\n if options[:prefix]\n prefix = options[:prefix]\n elsif options[:prefix] == false\n prefix = ''\n else\n prefix = ' '\n end\n\n # Separator\n unless options[:separator].blank?\n separator = options[:separator]\n else\n separator = '|'\n end\n\n # Suffix (trailing space)\n if options[:suffix]\n suffix = options[:suffix]\n elsif options[:suffix] == false\n suffix = ''\n else\n suffix = ' '\n end\n \n # Lowercase title?\n if options[:lowercase] == true\n @title = @title.downcase unless @title.blank?\n end\n \n # Default page title\n if @title.blank? && options[:default]\n @title = options[:default]\n end\n\n buffer = \"\"\n\n # Set website/page order\n if @title.blank?\n # If title is blank, return only website name\n buffer << content_tag(:title, options[:site]) \n else\n if options[:reverse] == true\n # Reverse order => \"Page : Website\"\n buffer << content_tag(:title, @title + prefix + separator + suffix + options[:site])\n else\n # Standard order => \"Website : Page\"\n buffer << content_tag(:title, options[:site] + prefix + separator + suffix + @title)\n end\n end\n \n buffer << \"\\n\"\n\t\tbuffer << tag(:meta, \"http-equiv\" => \"Content-type\", :content => \"text/html; charset=#{options[:charset]}\")\n\t\tbuffer << csrf_meta_tag\n\t\tbuffer.html_safe\n end", "def headers=(new_headers)\n @_response ||= ActionDispatch::Response.new\n @_response.headers.replace(new_headers)\n end", "def headers\n call_once\n @headers\n end", "def set_request_headers!(request); end", "def vary_headers; end", "def set_header_fields(request)\n request.smb2_header.tree_id = id\n request.smb2_header.credits = 256\n request\n end", "def set_default_response_headers\n\t\tsuper\n\t\tif response && request && request_in_blog?\n\t\t\t# Embed only on the blog site.\n\t\t\tallowed_url = blog_url\n\t\t\treferrer = request.headers['Referer']\n\t\t\tif referrer && (referrer.start_with?(allowed_url) || referrer.start_with?(root_url))\n\t\t\t\texisting_csp = response.headers['Content-Security-Policy']\n\t\t\t\tnew_csp = \"frame-ancestors #{allowed_url}\"\n\t\t\t\tresponse.headers.merge!({\n\t\t\t\t\t'Content-Security-Policy' => [existing_csp, new_csp].compact.join('; '),\n\t\t\t\t\t'X-Frame-Options' => \"ALLOW-FROM #{allowed_url}\"\n\t\t\t\t})\n\t\t\tend\n\t\tend\n\tend", "def set_header_for_iframe\n response.headers.delete \"X-Frame-Options\"\n end", "def default_headers(arg=nil)\n set_headers\n end", "def configure(builder)\n builder.headers[:user_agent] = @user_agent\n builder.headers[:'X-Asana-Client-Lib'] = header\n end", "def setup\n @headers = {}\n @headers[\"User-Agent\"] = \"iPadApp\"\n @headers[\"Content-type\"] = \"application/json\"\n end", "def prerender_header_and_footer(options); end", "def set_headers # :nodoc:\n {\n 'User-Agent' => \"twm-ruby-#{VERSION}\",\n 'Content-Type' => 'application/json; charset=utf-8',\n 'Accept' => 'application/json'\n }\n end", "def headers\r\n # give access to helpers to opts with a different name\r\n @opts\r\n end", "def eh_request(*args)\n n=0\n spec = line_part_spec\n @page_headers[0][n] = spec\n end", "def set_header\n @header = Header.find(params[:id])\n end", "def set_header\n @header = Header.find(params[:id])\n end", "def set_page_title\n @page_title = \"Race Results Management\"\n end", "def write_header() \n @builder.head do\n @builder.title('OmniFocus OPML Export')\n @builder.dateCreated(Time.now.httpdate)\n @builder.dateModified(Time.now.httpdate)\n# TODO @builder.ownerName(\"\")\n# TODO @builder.ownerEmail('example@example.com')\n end\n end", "def set_page_data\n @page_title = \"Dragos | My Portfolio\"\n @seo_keywords = \"Dragos Portfolio\"\n end", "def set_pagination_header(resource,resource_name)\n #print current page\n headers[\"x-page\"] = page\n #print records per page\n headers[\"x-per-page\"] = per_page\n #print total records\n headers[\"x-total\"] = resource.total_count\n #print next page url\n headers[\"next_page\"] = eval \"api_v1_#{resource_name}_url(request.query_parameters.merge(page: resource.next_page))\" if resource.next_page\n #print prev page url\n headers[\"prev_page\"] = eval \"api_v1_#{resource_name}_url(request.query_parameters.merge(page: resource.next_page))\" if resource.prev_page\n end", "def oh_request(*args)\n n=0\n spec = line_part_spec\n @page_headers[1][n] = spec\n end", "def vary_headers=(_arg0); end", "def headers(headers)\n @headers = headers\n end", "def header\n @io.content_type = content_type if @io.respond_to?(:content_type)\n\n @io << \"<html>\"\n @io << tag(:head) do |headers|\n headers << tag(:title, 'Request-log-analyzer report')\n headers << tag(:style, '\n body {\n \tfont: normal 11px auto \"Trebuchet MS\", Verdana, Arial, Helvetica, sans-serif;\n \tcolor: #4f6b72;\n \tbackground: #E6EAE9;\n \tpadding-left:20px;\n \tpadding-top:20px;\n \tpadding-bottom:20px;\n }\n\n a {\n \tcolor: #c75f3e;\n }\n\n .color_bar {\n border: 1px solid;\n height:10px;\n \tbackground: #CAE8EA;\n }\n\n #mytable {\n \twidth: 700px;\n \tpadding: 0;\n \tmargin: 0;\n \tpadding-bottom:10px;\n }\n\n caption {\n \tpadding: 0 0 5px 0;\n \twidth: 700px;\t\n \tfont: italic 11px \"Trebuchet MS\", Verdana, Arial, Helvetica, sans-serif;\n \ttext-align: right;\n }\n\n th {\n \tfont: bold 11px \"Trebuchet MS\", Verdana, Arial, Helvetica, sans-serif;\n \tcolor: #4f6b72;\n \tborder-right: 1px solid #C1DAD7;\n \tborder-bottom: 1px solid #C1DAD7;\n \tborder-top: 1px solid #C1DAD7;\n \tletter-spacing: 2px;\n \ttext-transform: uppercase;\n \ttext-align: left;\n \tpadding: 6px 6px 6px 12px;\n \tbackground: #CAE8EA url(images/bg_header.jpg) no-repeat;\n }\n\n td {\n \tfont: bold 11px \"Trebuchet MS\", Verdana, Arial, Helvetica, sans-serif;\n \tborder-right: 1px solid #C1DAD7;\n \tborder-bottom: 1px solid #C1DAD7;\n \tbackground: #fff;\n \tpadding: 6px 6px 6px 12px;\n \tcolor: #4f6b72;\n }\n\n td.alt {\n \tbackground: #F5FAFA;\n \tcolor: #797268;\n }\n ', :type => \"text/css\")\n end\n @io << '<body>'\n @io << tag(:h1, 'Request-log-analyzer summary report')\n @io << tag(:p, \"Version #{RequestLogAnalyzer::VERSION} - written by Willem van Bergen and Bart ten Brinke\")\n end", "def initialize_http_header(initheader)\n super\n set_headers_for_body\n end", "def wizard_header()\n header = '<meta name=\"wizard_controller\" content=\"'+@wizard_controller+'\" />'\n header += '<meta name=\"wizard_id_prefix\" content=\"'+@wizard_id_prefix+'\" />'\n end", "def Header\r\n\t\tif @page == 1\r\n\t\t\tfirst_page_header\r\n\t\telse\r\n\t\t\tpage_header\t\r\n\t\tend\r\n\tend", "def pos_rseg_header\n pos_page_body\n end", "def set_export_headers\n response.headers[\"Cache-Control\"] = \"cache, must-revalidate\"\n response.headers[\"Pragma\"] = \"public\"\n end", "def headers=(hash); end", "def headers=(hash); end", "def set_header(auth_headers)\n header 'access-token', auth_headers['access-token']\n header 'token-type', auth_headers['token-type']\n header 'client', auth_headers['client']\n header 'expiry', auth_headers['expiry']\n header 'uid', auth_headers['uid']\nend", "def perform\n add_request_if_new do |request|\n request.header_set(*arguments)\n end\n end", "def header(in_page=\"\")\n\t # workaround to shoes/shoes4#1212:\n\t $clicky ||= []\n\t $clicky.each{ |i| i.hide }\n\t $clicky = []\n\t \n\t # Header\n\t self.scroll_top = 0\n\t background pattern(img_path \"bg1.png\")\n\t stack do\n\t background enve_blue(0.4)\n\t stack{ background rgb(0,0,0,1.0) } # workaround to shoes/shoes4#1190\n\t flow(width:1.0) do\n\t stack(width:40){}\n\t menu = [\n\t\t [\"Home\",\"/\",\"noun_208357_cc.png\"],\n\t\t [\"All tasks\",\"/index\",\"noun_208394_cc.png\"],\n\t\t [\"Examples\",\"/examples\",\"noun_229087_cc.png\"],\n\t\t [\"Update\",\"/update\",\"noun_229107_cc.png\"],\n\t\t [\"Website\",\"http://enve-omics.ce.gatech.edu/\",\n\t\t \"noun_208472_cc.png\"],\n\t\t [\"About\",\"/about\",\"noun_229118_cc.png\"]\n\t ]\n\t menu.each do |i|\n\t\t flow(width:60, height:65) do\n\t\t if i[1]==in_page\n\t\t\tbackground enve_blue(0.4)\n\t\t\tstack{ background rgb(0,0,0,1.0) } # shoes/shoes4#1190\n\t\t end\n\t\t stack(width:5, height:50){}\n\t\t stack(width:50) do\n\t\t\timage img_path((i[1]==in_page ? \"w-\" : \"\")+i[2]),\n\t\t\t width:50, height:50, margin:2\n\t\t\tinscription i[0], align:\"center\",\n\t\t\t size:(linux? ? 8 : 10),\n\t\t\t stroke: (i[1]==in_page ? white : black)\n\t\t end\n\t\t stack(width:5){}\n\t\t end.click{ (i[1]=~/^https?:/) ? open_url(i[1]) : visit(i[1]) }\n\t\t stack(width:5){}\n\t end\n\t end\n\t stack(height:5, width:1.0){}\n\t stack(height:2, width:1.0) { background black }\n\t end\n\t stack(height:20, width:1.0){}\n end", "def seo_for_page\n PAGE_SEO_META.each do |meta|\n send(\"set_#{meta}_key\", \"#{seo_condition[:prefix]}#{meta}\")\n end\n\n set_title_variables(seo_variables)\n end", "def render\n renderer.render_header self\n end", "def welcome\n @header = \"This is the Welcome Page\"\n end", "def welcome\n @header = \"This is the Welcome Page\"\n end", "def set_response_headers(headers)\n new(\n response_headers: ConnSupport::Headers.normalize(headers)\n )\n end", "def index \n @headers['Content-Type']='text/html; charset=UTF-8'\n end", "def set_info\n @page_header = 'Dashboard'\n @page_title = 'LeadAccount | Dashboard'\n @page_icon = 'dashboard'\n end", "def set_pragma\n if ssl_request? && ie_request?\n @controller.headers['Pragma'] = 'public' # added to make ie ssl pdfs work (per naisayer)\n else\n @controller.headers['Pragma'] ||= ie_request? ? 'no-cache' : ''\n end\n end", "def set_defaults\n\t\t@headers[:server] = Mongrel2.version_string( true )\n\tend", "def headers=(hash)\n if headers\n headers.replace hash\n else\n super\n end\n end", "def set_header name, value\n response_object.header name, value\n end", "def headers\n {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'}\n end", "def headers=(headers)\n @headers = headers if headers.kind_of? Hash\n end", "def SetPrintHeader(val=true)\n\t\t@print_header = val;\n\tend", "def send_headers response_code\n end", "def set_codepage_header(codepage_header)\n begin\n codepage_header = HeaderNames::CPN[codepage_header] || codepage_header\n case codepage_header.downcase.to_sym\n when HeaderNames::CPN[HeaderOption::CPN::UNITED_STATES]\n @gsi.cpn = HeaderOption::CPN::UNITED_STATES\n @codepage_header = CodePage::Header::UnitedStates\n when HeaderNames::CPN[HeaderOption::CPN::MULTILINGUAL]\n @gsi.cpn = HeaderOption::CPN::MULTILINGUAL\n @codepage_header = CodePage::Header::Multilingual\n when HeaderNames::CPN[HeaderOption::CPN::PORTUGAL]\n @gsi.cpn = HeaderOption::CPN::PORTUGAL\n @codepage_header = CodePage::Header::Portugal\n when HeaderNames::CPN[HeaderOption::CPN::CANADA_FRENCH]\n @gsi.cpn = HeaderOption::CPN::CANADA_FRENCH\n @codepage_header = CodePage::Header::CanadaFrench\n when HeaderNames::CPN[HeaderOption::CPN::NORWAY]\n @gsi.cpn = HeaderOption::CPN::NORWAY\n @codepage_header = CodePage::Header::Norway\n else\n codepage_header = HeaderDefault::CPN\n raise ArgumentError\n end\n rescue ArgumentError\n retry\n end\n end", "def headers; return {}; end", "def headers; return {}; end", "def headers= headers\n @headers = headers\n headers.each do |attr, value|\n `#@native.setRequestHeader(attr, value)`\n end\n end" ]
[ "0.64804345", "0.61778986", "0.6094569", "0.60413307", "0.6010624", "0.6004721", "0.59677815", "0.5965604", "0.59422946", "0.59367436", "0.5924764", "0.59143287", "0.59120494", "0.5895154", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5886509", "0.5885586", "0.585805", "0.5842824", "0.58372533", "0.5817329", "0.57965696", "0.57965696", "0.57965696", "0.5794649", "0.5772166", "0.5771965", "0.5760724", "0.5733357", "0.5729734", "0.57201225", "0.5713814", "0.5708415", "0.5699628", "0.5690909", "0.5683302", "0.5672407", "0.56719536", "0.5668308", "0.56673425", "0.56524277", "0.5650288", "0.56309724", "0.56246287", "0.56239194", "0.56082153", "0.55649", "0.55635476", "0.5563192", "0.5560071", "0.555783", "0.55475825", "0.55443287", "0.5532747", "0.5532747", "0.55297846", "0.5529072", "0.54946685", "0.54946476", "0.5493397", "0.54857624", "0.5484428", "0.5481295", "0.54777735", "0.54747504", "0.5472035", "0.546792", "0.5464678", "0.54598635", "0.54598635", "0.5452", "0.5448288", "0.5442197", "0.54324985", "0.5430422", "0.5421844", "0.5421844", "0.5420152", "0.54150563", "0.5414375", "0.5411174", "0.5401538", "0.540124", "0.5401136", "0.5395881", "0.5379701", "0.53681403", "0.5363931", "0.5360655", "0.5360233", "0.5360233", "0.53564006" ]
0.63729626
1
Use callbacks to share common setup or constraints between actions.
def set_langual_factor @langual_factor = LangualFactor.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Only allow a trusted parameter "white list" through.
def langual_factor_params params.require(:langual_factor).permit(:description) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n [:rating, :review]\n end", "def valid_params?; end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
For this example, we are simply using token authentication via parameters. However, anyone could use Rails's token authentication features to get the token from a header.
def authenticate_user_from_token! user_email = params[:user_email].presence user = user_email && User.find_by_email(user_email) # Notice we are passing store false, so the user is not # actually stored in the session and a token is needed # for every request. If you want the token to work as a # sign in token, you can simply remove store: false. if user && Devise.secure_compare(user.auth_token, params[:auth_token]) sign_in user, store: false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def token\n request.headers[\"Authorization\"]\n end", "def token\n request.headers['Authorization']\n end", "def token(request)\n end", "def get_token\n request.headers[\"Authorization\"]\n end", "def token(auth_code = T.unsafe(nil), headers = T.unsafe(nil)); end", "def auth_header # gets the authorization header from the request\n # { Authorization: 'Bearer <token>' }\n request.headers['Authorization']\n end", "def authenticate_with_token\n # get the token from the header\n # get the token from the post body\n # get the token from json post\n \n token = request.headers[\"HTTP_AUTHORIZATION\"]\n \n if (!token)\n if (not_protected self.controller_name, self.action_name)\n return nil\n end\n\n redirect_to controller: 'application', action: 'index' \n end\n\n #@user = get_user_by_token(token)\n end", "def token\n authenticated\n end", "def get_authentication_header\n \"#{token_type} #{token}\"\n end", "def authenticate_token \n\t\tauthenticate_with_http_token do | token, options| \n\t\t\tUser.find_by(auth_token: token)\n\t\tend\n\tend", "def auth_token_param\n params[:auth_token]\n end", "def auth_header\n # headers: { 'Authorization': 'Bearer <token>' }\n\n request.headers['Authorization']\n # => 'Bearer <token>'\n end", "def get_token\n if params.has_key?(:token) && params[:token] != ''\n return params[:token]\n end\n return nil if !request || !request.headers\n token_response = request.headers['Authorization']\n return nil if !token_response\n token_response[/^Token (.*)/,1]\n end", "def auth_token\n\t\trequest.headers['X-AUTH-TOKEN']\n\tend", "def authenticate_token\n authenticate_with_http_token do |token, options|\n token == 'ABC'\n end\n end", "def token_auth(*args, &block); end", "def request_token\n @token=current_client_application.create_request_token\n if @token\n render :text=>@token.to_query\n else\n render :nothing => true, :status => 401\n end\n end", "def api_authenticate\n if request.headers[\"Authorization\"].present?\n # Take the last part in The header (ignore Bearer)\n auth_header = request.headers['Authorization'].split(' ').last\n # Are we feeling alright!?\n @token_payload = decodeJWT auth_header.strip\n if !@token_payload\n render json: { error: 'The provided token wasn´t correct' }, status: :bad_request\n end\n else\n render json: { error: 'Need to include the Authorization header' }, status: :forbidden # The header isn´t present\n end\n end", "def authenticate_api_token\n if request.headers[\"Authorization\"].present?\n \n auth_header = request.headers['Authorization'].split(' ').last\n \n #try to get the data from jwt token\n @payload = decode auth_header\n \n #couldnt get data for whatever reason\n if !@payload\n render json: { error: \"Problem med autentiseringssträngen. Försök att logga in igen.\" }, status: :bad_request \n #success!\n else\n @payload\n end\n #no token was sent with header \n else\n render json: { error: \"En autentiseringssträng krävs.\"}, status: :forbidden # The header isn´t present\n end\n end", "def request_token\n @token = current_client_application.create_request_token\n if @token\n render :text => @token.to_query\n else\n render :nothing => true, :status => 401\n end\n end", "def token\n if request.headers[\"Authorization\"].present?\n if !login_from_authorization(request.headers['Authorization'].split(\" \")[1])\n response.set_header('WWW-Authenticate', \"Basic realm=\\\"red\\\"\")\n render json: {\"errors\":[{\"code\":\"UNAUTHORIZED\"}]} , status: 401\n return\n end\n else\n render json: {}, status: 401\n return\n end\n\n token = Portus::JwtToken.new(params[:account], params[:service], authorize_scopes)\n logger.tagged(\"jwt_token\", \"claim\") { logger.debug token.claim }\n render json: token.encoded_hash\n end", "def api_authenticate\n if request.headers[\"Authorization\"].present?\n auth_header = request.headers['Authorization'].split(' ').last\n @token_payload = decodeJWT auth_header.strip\n if !@token_payload\n render json: { error: 'The provided token wasn´t correct' }, status: :bad_request \n end\n else\n render json: { error: 'Need to include the Authorization header' }, status: :forbidden # The header isn´t present\n end\n end", "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n # else\n # authentication_error\n end\n end", "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n else\n authentication_error\n end\n end", "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n else\n authentication_error\n end\n end", "def token\n bearer = request.headers[\"HTTP_AUTHORIZATION\"]\n\n # allows our tests to pass\n bearer ||= request.headers[\"rack.session\"].try(:[], 'Authorization')\n\n if bearer.present?\n bearer.split.last\n else\n nil\n end\n end", "def token\n bearer = request.headers[\"HTTP_AUTHORIZATION\"]\n\n # allows our tests to pass\n bearer ||= request.headers[\"rack.session\"].try(:[], 'Authorization')\n\n if bearer.present?\n bearer.split.last\n else\n nil\n end\n end", "def get_authentication_header\n acquire_token if token_expired\n \"#{token_type} #{token}\"\n end", "def bearer_token(token)\n @header.merge!({ 'Authorization' => \"Bearer #{token}\" })\n end", "def auth_token\n @auth_token ||= request.headers.fetch('Authorization', '').split(' ').last\n end", "def get_authentication_header\n acquire_token if token_expired?\n \"#{token_type} #{token}\"\n end", "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n\n if auth_token\n authenticate_with_auth_token auth_token\n else\n authenticate_error\n end\n end", "def token\r\n bearer = request.headers[\"HTTP_AUTHORIZATION\"]\r\n\r\n # allows our tests to pass\r\n bearer ||= request.headers[\"rack.session\"].try(:[], 'Authorization')\r\n\r\n if bearer.present?\r\n bearer.split.last\r\n else\r\n nil\r\n end\r\n end", "def header_token\n request.headers['Authorization'].split(' ').last\n end", "def login_by_token\n\n end", "def auth_header\n if token\n { \"Authorization\" => \"Bearer #{token}\" }\n else\n {}\n end\n end", "def getHeader\n #updateToken\n {'Content-Type' => 'application/json', 'Authorization' => 'Bearer ' + @token}\n end", "def auth_header\n { 'Authorization': \"Bearer #{@auth.token}\" }.with_indifferent_access\n end", "def process_token\n if request.headers['Authorization'].present?\n begin\n token = request.headers['Authorization'].split(' ')[1]\n #jwt_payload = JWT.decode(request.headers['Authorization'].split(' ')[1], Rails.application.secrets.secret_key_base).first\n jwt_payload = JWT.decode(token, nil, false)[0]\n @current_user_id = jwt_payload['id']\n rescue JWT::ExpiredSignature, JWT::VerificationError, JWT::DecodeError\n head :unauthorized\n end\n end\n end", "def authenticate_bearer(header)\n @token ||= {}\n @token[header] ||= orig_authenticate_bearer(header)\n end", "def get_token\n token = params[:user_token].presence\n\n token_options = {}\n\n # get token from Authentication header\n if token.blank?\n # enable devise to get auth token in header\n # expects header with name \"Authorization\" and value 'Token token=\"tokenvalue\"'\n # @see https://groups.google.com/forum/?fromgroups#!topic/plataformatec-devise/o3Gqgl0yUZo\n # @see http://api.rubyonrails.org/v3.2.19/classes/ActionController/HttpAuthentication/Token.html\n token_with_options = ActionController::HttpAuthentication::Token.token_and_options(request)\n token = token_with_options[0] if token_with_options\n token_options = token_with_options[1] if token_with_options\n end\n\n [token, token_options]\n end", "def expose_token\n @token = ApiToken.where(code: params[:token]).first\n end", "def auth_token\n TokenProvider.issue_token(\n first_name: object.first_name,\n last_name: object.last_name,\n username: object.username,\n user_id: object.id,\n role: object.role\n )\n end", "def auth_header(token = nil)\n if token == nil\n # Make sure we have what we need to do this\n if OAuthToken == nil; raise ArgumentError \"Request: A token wasn't set, can't make request without a token.\", caller; end\n return { Authorization: \"Bearer #{OAuthToken}\" }\n end\n\n # Use the passed token if available\n return { Authorization: \"Bearer #{token}\"}\n end", "def auth_token\n Auth.decode(header_token)\n end", "def request_token(params)\n header = {}\n\n if @endpoint_auth == :basic\n header = { authorization: 'Basic ' + Base64.encode64(\"#{@client_id}:#{@client_secret}\") }\n else\n params[:client_id] = @client_id\n params[:client_secret] = @client_secret\n end\n\n request = Net::HTTP::Post.new(@token_endpoint, header)\n request.form_data = params\n Net::HTTP.start(@host.hostname, @host.port, use_ssl: true) { |http| http.request(request) }\n end", "def authentication_token\n generate_token(:authentication_token)\n end", "def bearer_token\n \"Bearer #{token}\"\n end", "def token\n @api.get(\"#{Paths::TOKENS}\")\n end", "def authentication_token\n @authentication_token ||= authorization_header.gsub(BEARER_PATTERN, '')\n end", "def token_auth\n Hash['type' => 'token',\n 'token' => @token,]\n end", "def auth_header\n # { Authorization: 'Bearer <token>' }\n request.headers['Authorization']\n end", "def do_token(params, clientId, clientSecret)\n # Call Authlete's /auth/token API.\n response = call_token_api(params, clientId, clientSecret)\n\n # The content of the response to the client.\n content = response[\"responseContent\"]\n\n # \"action\" denotes the next action.\n case response[\"action\"]\n when \"INVALID_CLIENT\"\n # 401 Unauthorized\n # Client authentication failed.\n return WebResponse.new(401, content).json\\\n .wwwAuthenticate(\"Basic realm=\\\"/token\\\"\").to_response\n\n when \"INTERNAL_SERVER_ERROR\"\n # 500 Internal Server Error\n # The API request from this implementation was wrong\n # or an error occurred in Authlete.\n return WebResponse.new(500, content).json.to_response\n\n when \"BAD_REQUEST\"\n # 400 Bad Request\n # The token request from the client was wrong.\n return WebResponse.new(400, content).json.to_response\n\n when \"PASSWORD\"\n # Process the token request whose flow is\n # \"Resource Owner Password Credentials\".\n return handle_password(response)\n\n when \"OK\"\n # 200 OK\n # The token request from the client was valid. An access\n # token is issued to the client application.\n return WebResponse.new(200, content).json.to_response\n\n else\n # This never happens.\n return WebResponse.new(500, \"Unknown action\").plain.to_response\n end\nend", "def auth_header\n\t\t# { Authorization: 'Bearer <token>' }\n\t\trequest.headers['Authorization']\n\tend", "def token\n\n authenticate_with_http_basic do |email, password|\n user = User.find_by(email: email)\n if user && user.authenticate(password) \n render json: { token: user.api_token }\n else\n render json: { error: 'Incorrect credentials' }, status: 401\n end\n\n end\n end", "def get_token\n session[:token] if authorized?\n end", "def authorization_token\n @authorization_token ||= request.headers['Authorization']&.split(' ')&.last\n end", "def http_auth_token\n request.headers['Authorization']&.split(' ')&.last\n end", "def http_auth_token\n\n @http_auth_token ||= if request.headers.present?\n request.headers[\"HTTP_AUTH_TOKEN\"]\n end\n end", "def authenticate\n authenticate_or_request_with_http_token do |token _options|\n @current_user = User.find_by token: token\n end\n end", "def authenticate_token\n @is_authenticated = false\n if request.headers[\"TOKEN\"]\n if request.headers[\"TOKEN\"] == \"AppDipre\"\n @is_authenticated = true\n end\n end\n end", "def authenticate_token\n @is_authenticated = false\n if request.headers[\"TOKEN\"]\n if request.headers[\"TOKEN\"] == \"AppDipre\"\n @is_authenticated = true\n end\n end\n end", "def token\n authenticate_username_password || render_unauthorized\n end", "def http_token\n @http_token ||= if request.headers['Authorization'].present?\n request.headers['Authorization'].split(' ').last\n end\n end", "def request_token(options = {})\n consumer(:scheme => (@@request_scheme || :header)).get_request_token(options)\n end", "def authenticate_token\n render json: {message: \"Unauthorized\"}, status: 401 unless decode_token(bearer_token)\n end", "def http_auth_token\n @http_auth_token ||= if request.headers['Authorization'].present?\n request.headers['Authorization'].split(' ').last\n end\n end", "def token\n authenticate_username_password || render_unauthorized\n end", "def authenticate_token\n authenticate_with_http_token do |token, options|\n User.find_by(auth_token: token)\n end\n end", "def authenticate_user_from_token!\n auth_token = request.headers['Authorization']\n client_id = request.headers['Client-ID']\n\n if auth_token\n authenticate_with_auth_token(auth_token, client_id)\n else\n authentication_error\n end\n end", "def extract_bearer_token(request)\n if request.headers['Authorization'].present?\n token = request.headers['Authorization'].split.last\n token.gsub!(/(\\'|\\\")/, '')\n token\n end\n end", "def header\n { \"Authorization\" => 'Bearer ' + request_access_token.token }\n end", "def api_token\n if @token.nil?\n raise ArgumentError, 'username is missing' if username.blank?\n raise ArgumentError, 'password is missing' if password.blank?\n response = connection.post do |req|\n req.url '/Authentication/V2.0'\n req.headers['x-dnb-user'] = username\n req.headers['x-dnb-pwd'] = password\n end\n @token = response.headers['Authorization']\n end\n @token\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def defaultHeaders(token)\n { 'Accept' => '*/*',\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' + token }\nend", "def token_auth(token, options = nil)\n set_authorization_header(:token_auth, token, options)\n end", "def authorize_request\n authenticate_with_http_token do |token, options|\n User.find_by(token: token)\n end\n end", "def authentication_token\n if env && env['HTTP_AUTHORIZATION']\n env['HTTP_AUTHORIZATION'].split(\" \").last\n end\n end", "def jwt_auth_header\n { Authorization: \"Bearer #{Quovo::Token.get}\" }\n end", "def token\n authenticate_with_http_basic do |username, password|\n\n user = User.find_by(username: username)\n if user && user.password == password\n render json: { token: user.token }\n else\n render json: { error: 'Incorrect credentials' }, status: 401\n end\n\n end\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def token; config[:token]; end", "def http_auth_header\n if header['Authorization'].present?\n return header['Authorization'].split(' ').last\n end\n raise(ExceptionHandler::MissingToken, 'Missing_token') #should be refactored into a singleton class man \n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n raise \"Please set your CLIENT_ID\" if CLIENT_ID.nil?\n raise \"Please set your CLIENT_SECRET\" if CLIENT_SECRET.nil?\n\n # Build our params hash\n params = {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\nend", "def get_token\n get(TOKEN_URL)\n end", "def create_set_and_add_token\n token = SecureRandom.urlsafe_base64\n @user.token = token\n response.headers['X-AUTH-TOKEN'] = token\n end", "def extract_header_token(env)\n BEARER_TOKEN_REGEX.match(env['HTTP_AUTHORIZATION'])&.[](1)\n end", "def headers_with_auth(token)\n return @headers unless token\n\n headers = @headers\n headers[\"Authorization\"] = \"Bearer #{token}\"\n headers\n end", "def authorize_request\n authenticate_with_http_token do |token, option|\n User.find_by(token: token)\n end\n end", "def authenticate_token\n authenticate_with_http_token do |token, options|\n @current_user = User.find_by(token: token)\n @current_user\n end\n end", "def authenticate\n token = request.headers[\"Authorization\"].split(' ')[1]\n payload = JWT.decode(token, @@jwt_secret, true, { algorithm: 'HS512' })[0]\n @username = payload[\"username\"]\n rescue StandardError\n render json: { error: \"Invalid token\" }, status: :unauthorized\n end", "def initialize\n @token_type = 'bearer'\n end", "def bearer_token\n # Put the url together\n url = \"#{API_HOST}#{TOKEN_PATH}\"\n\n # Build our params hash\n params = {\n client_id: @client_id,\n client_secret: @client_secret,\n grant_type: GRANT_TYPE\n }\n\n response = HTTP.post(url, params: params)\n parsed = response.parse\n\n \"#{parsed['token_type']} #{parsed['access_token']}\"\n end", "def authorize_request\n\t\tauthenticate_with_http_token do |token, options|\n\t\t\tUser.find_by(token: token)\n\t\tend\n\tend", "def bearer_token\n \"Bearer #{verification_token}\"\n end", "def headers\n {'Authorization' => options[:header_format] % token}\n end", "def auth_token\n @auth_token ||= ActionController::HttpAuthentication::Token.token_and_options(request)\n end", "def api_auth\n # output the APIkey from the header\n # puts request.headers[\"X-APIkey\"];\n creator = Creator.find_by(creator: request.headers[:creator])\n if creator && creator.authenticate(request.headers[:password])\n render json: { auth_token: encodeJWT(creator), id: creator.id}\n else\n render json: { error: 'Invalid username or password' }, status: :unauthorized\n end\n end", "def authenticate_user_from_token!\n\t\t@api_token = ApiToken.find_by_token(params[:token])\n @user = @api_token.try(:user)\n if @user.nil?\n render json: { error: 'Not authorized' }, status: 401\n end\n end", "def set_header(token)\n response.headers['Authorization'] = \"Bearer #{token.to_jwt}\"\n end", "def request_token\n self.token = Pivotal::Client.fetch_token(email, password)\n end" ]
[ "0.78677654", "0.7867661", "0.77609175", "0.7755275", "0.76498723", "0.75415516", "0.73891926", "0.7334458", "0.7309852", "0.7240654", "0.72284627", "0.72151905", "0.7183141", "0.7169413", "0.71585006", "0.7144371", "0.7143278", "0.7142817", "0.71351194", "0.71279824", "0.71191543", "0.71173054", "0.70963466", "0.7095137", "0.7095137", "0.70799416", "0.70799416", "0.7079287", "0.70734686", "0.7049686", "0.7048421", "0.70442575", "0.7041008", "0.70166385", "0.70124406", "0.70067984", "0.70008206", "0.69800514", "0.695891", "0.69448847", "0.6930594", "0.6919789", "0.6881757", "0.68756723", "0.6873347", "0.68724924", "0.68474257", "0.6844938", "0.6832208", "0.68314683", "0.682605", "0.6825665", "0.6821328", "0.6820417", "0.6806283", "0.68036723", "0.68032306", "0.6802244", "0.68021786", "0.68011534", "0.68003356", "0.68003356", "0.6797584", "0.67967993", "0.6791806", "0.67880964", "0.67691165", "0.67667776", "0.67652774", "0.67638755", "0.6752995", "0.67495483", "0.67476094", "0.6723414", "0.6713918", "0.6712818", "0.6706607", "0.67038536", "0.6703387", "0.6698077", "0.66968375", "0.66949725", "0.6694014", "0.6690677", "0.66894686", "0.66882294", "0.6683211", "0.667904", "0.6678834", "0.66725856", "0.66719925", "0.6669615", "0.66687435", "0.66646874", "0.66581744", "0.6654041", "0.6641631", "0.6634291", "0.6629198", "0.6620687", "0.6615629" ]
0.0
-1
Delete L2 Bridge Endpoint Profile API will delete L2 bridge profile with ID profileid
def delete_l2_bridge_profile(site_id, enforcement_point_id, profile_id, opts = {}) delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @profile.destroy\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n end", "def delete_profile( profile_name )\n delete_all_accessors(profile_name)\n\n profile_id = find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\", { :opts => 'delete', :random => generate_random_number }\n req.headers = @authorization_headers.merge({'enctype'=>'multipart/form-data'})\n end\n\n profile_id = response.body\n return profile_id\n end", "def delete_profile(profile_id)\n @type = Type::CIM_DELETE_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n redirect_to profiles_url\n end", "def destroy\n @profile = current_user.profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_path, :notice => \"profile was successfully delete.\" }\n format.json { head :no_content }\n end\n end", "def delete_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#delete_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling delete_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/delete\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#delete_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_profile_component\n @profile = Profile.find(params[:id])\n @structure_component = StructureComponent.find(@profile.structure_component_id)\n @profile.destroy\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def remove(profile)\n @repository_xml.root.delete_element(\"profile[@id='#{profile}']\")\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @users_profile = Users::Profile.find(params[:id])\n @users_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n redirect_to '/'\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n format.html { redirect_to(user_profiles_url) }\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def destroy\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n @profile_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_attributes_url) }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n end\n end", "def destroy\n @tag_pro_profile.destroy\n respond_with(@tag_pro_profile, location: root_url)\n end", "def destroy\n # @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, :notice => t('alerts.profiles.destroy') }\n format.json { head :no_content }\n end\n end", "def destroy\n raise params.inspect\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user.profile.destroy\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize @profile\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: \"Profile: #{I18n.t('helpers.deleted')}\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Profile was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n # @profile = Profile.find(params[:id])\n # authorize! :destroy, @profile\n\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pay_profile = PayProfile.find(params[:id])\n @pay_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to pay_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@profile.destroy\n\t\tset_flash_message :notice, :destroyed\n\t\tredirect_to admin_profiles_url\n\tend", "def sell_shipping_profile_delete (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.delete url, req \r\n end \r\n end", "def destroy\n @profile.destroy\n session[:profile_id] = nil\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_with(@profile)\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bprofile.destroy\n respond_to do |format|\n format.html { redirect_to bprofiles_url, notice: 'Bprofile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @climber_profile.destroy\n respond_to do |format|\n format.html { redirect_to climber_profiles_url, notice: 'Climber profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n flash[:notice] = 'Profile was successfully deleted.'\n respond_to do |format|\n format.html { redirect_to(space_user_profile_url(@space, @user)) }\n format.xml { head :ok }\n format.atom { head :ok }\n end\n end", "def delete_instance_profile(instance_profile_name)\n request(\n 'Action' => 'DeleteInstanceProfile',\n 'InstanceProfileName' => instance_profile_name,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "def destroy\n @profile = self.current_member.profile\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to current_member_profile_path }\n format.xml { head :ok }\n end\n end", "def destroy\n @private_profile = PrivateProfile.find(params[:id])\n @private_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to private_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n institution = @profile.institution\n begin\n @profile.destroy!\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Profile deleted\",\n message: \"The metadata profile \\\"#{@profile.name}\\\" has been \"\\\n \"deleted.\")\n ensure\n if current_user.sysadmin?\n redirect_to institution_path(institution)\n else\n redirect_to metadata_profiles_path\n end\n end\n end", "def delete_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n nil\n end", "def remove_profile(project_root)\n # Choose a profile from the availables\n profiles = Bebox::Profile.list(project_root)\n # Get a profile if exist\n if profiles.count > 0\n profile = choose_option(profiles, _('wizard.choose_remove_profile'))\n else\n return error _('wizard.profile.no_deletion_profiles')\n end\n # Ask for deletion confirmation\n return warn(_('wizard.no_changes')) unless confirm_action?(_('wizard.profile.confirm_deletion'))\n # Profile deletion\n profile_name = profile.split('/').last\n profile_base_path = profile.split('/')[0...-1].join('/')\n profile = Bebox::Profile.new(profile_name, project_root, profile_base_path)\n output = profile.remove\n ok _('wizard.profile.deletion_success')\n return output\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: '*Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retailer_profile.destroy\n respond_to do |format|\n format.html { redirect_to retailer_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html do\n redirect_to profiles_url, notice:\n \"Profile was successfully destroyed.\"\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.73535186", "0.73372966", "0.7275864", "0.7172895", "0.70331097", "0.6998336", "0.69751936", "0.6962235", "0.6958074", "0.69547355", "0.6954444", "0.6954444", "0.6954444", "0.6952455", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6940198", "0.6940198", "0.6933357", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.6911826", "0.69048595", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.6884804", "0.6874728", "0.68729424", "0.68693346", "0.68606627", "0.6858907", "0.6854993", "0.68483496", "0.6838898", "0.6837585", "0.6834343", "0.683231", "0.6831432", "0.6830376", "0.68274814", "0.68224853", "0.68218523", "0.68218523", "0.6814163", "0.68136775", "0.68135387", "0.6811071", "0.67918175", "0.67896104", "0.67842466", "0.6783899", "0.67776114", "0.67773455", "0.67518014", "0.6746707", "0.6732391", "0.6732391", "0.6726696", "0.6720053", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431" ]
0.0
-1
Delete L2 Bridge Endpoint Profile API will delete L2 bridge profile with ID profileid
def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile" end # resource path local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @profile.destroy\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n end", "def delete_profile( profile_name )\n delete_all_accessors(profile_name)\n\n profile_id = find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\", { :opts => 'delete', :random => generate_random_number }\n req.headers = @authorization_headers.merge({'enctype'=>'multipart/form-data'})\n end\n\n profile_id = response.body\n return profile_id\n end", "def delete_profile(profile_id)\n @type = Type::CIM_DELETE_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n redirect_to profiles_url\n end", "def destroy\n @profile = current_user.profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_path, :notice => \"profile was successfully delete.\" }\n format.json { head :no_content }\n end\n end", "def delete_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#delete_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling delete_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/delete\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#delete_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_profile_component\n @profile = Profile.find(params[:id])\n @structure_component = StructureComponent.find(@profile.structure_component_id)\n @profile.destroy\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def remove(profile)\n @repository_xml.root.delete_element(\"profile[@id='#{profile}']\")\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @users_profile = Users::Profile.find(params[:id])\n @users_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n redirect_to '/'\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n format.html { redirect_to(user_profiles_url) }\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def destroy\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n @profile_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_attributes_url) }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n end\n end", "def destroy\n @tag_pro_profile.destroy\n respond_with(@tag_pro_profile, location: root_url)\n end", "def destroy\n # @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, :notice => t('alerts.profiles.destroy') }\n format.json { head :no_content }\n end\n end", "def destroy\n raise params.inspect\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user.profile.destroy\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize @profile\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: \"Profile: #{I18n.t('helpers.deleted')}\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Profile was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n # @profile = Profile.find(params[:id])\n # authorize! :destroy, @profile\n\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pay_profile = PayProfile.find(params[:id])\n @pay_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to pay_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@profile.destroy\n\t\tset_flash_message :notice, :destroyed\n\t\tredirect_to admin_profiles_url\n\tend", "def sell_shipping_profile_delete (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.delete url, req \r\n end \r\n end", "def destroy\n @profile.destroy\n session[:profile_id] = nil\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_with(@profile)\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bprofile.destroy\n respond_to do |format|\n format.html { redirect_to bprofiles_url, notice: 'Bprofile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @climber_profile.destroy\n respond_to do |format|\n format.html { redirect_to climber_profiles_url, notice: 'Climber profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n flash[:notice] = 'Profile was successfully deleted.'\n respond_to do |format|\n format.html { redirect_to(space_user_profile_url(@space, @user)) }\n format.xml { head :ok }\n format.atom { head :ok }\n end\n end", "def delete_instance_profile(instance_profile_name)\n request(\n 'Action' => 'DeleteInstanceProfile',\n 'InstanceProfileName' => instance_profile_name,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "def destroy\n @profile = self.current_member.profile\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to current_member_profile_path }\n format.xml { head :ok }\n end\n end", "def destroy\n @private_profile = PrivateProfile.find(params[:id])\n @private_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to private_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n institution = @profile.institution\n begin\n @profile.destroy!\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Profile deleted\",\n message: \"The metadata profile \\\"#{@profile.name}\\\" has been \"\\\n \"deleted.\")\n ensure\n if current_user.sysadmin?\n redirect_to institution_path(institution)\n else\n redirect_to metadata_profiles_path\n end\n end\n end", "def delete_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n nil\n end", "def remove_profile(project_root)\n # Choose a profile from the availables\n profiles = Bebox::Profile.list(project_root)\n # Get a profile if exist\n if profiles.count > 0\n profile = choose_option(profiles, _('wizard.choose_remove_profile'))\n else\n return error _('wizard.profile.no_deletion_profiles')\n end\n # Ask for deletion confirmation\n return warn(_('wizard.no_changes')) unless confirm_action?(_('wizard.profile.confirm_deletion'))\n # Profile deletion\n profile_name = profile.split('/').last\n profile_base_path = profile.split('/')[0...-1].join('/')\n profile = Bebox::Profile.new(profile_name, project_root, profile_base_path)\n output = profile.remove\n ok _('wizard.profile.deletion_success')\n return output\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: '*Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retailer_profile.destroy\n respond_to do |format|\n format.html { redirect_to retailer_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html do\n redirect_to profiles_url, notice:\n \"Profile was successfully destroyed.\"\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.73535186", "0.73372966", "0.7275864", "0.7172895", "0.70331097", "0.6998336", "0.69751936", "0.6962235", "0.6958074", "0.69547355", "0.6954444", "0.6954444", "0.6954444", "0.6952455", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6940198", "0.6940198", "0.6933357", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.6911826", "0.69048595", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.6884804", "0.6874728", "0.68729424", "0.68693346", "0.68606627", "0.6858907", "0.6854993", "0.68483496", "0.6838898", "0.6837585", "0.6834343", "0.683231", "0.6831432", "0.6830376", "0.68274814", "0.68224853", "0.68218523", "0.68218523", "0.6814163", "0.68136775", "0.68135387", "0.6811071", "0.67918175", "0.67896104", "0.67842466", "0.6783899", "0.67776114", "0.67773455", "0.67518014", "0.6746707", "0.6732391", "0.6732391", "0.6726696", "0.6720053", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431" ]
0.0
-1
Delete L2 Bridge Endpoint Profile API will delete L2 bridge profile with ID profileid
def delete_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {}) delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @profile.destroy\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n end", "def delete_profile( profile_name )\n delete_all_accessors(profile_name)\n\n profile_id = find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\", { :opts => 'delete', :random => generate_random_number }\n req.headers = @authorization_headers.merge({'enctype'=>'multipart/form-data'})\n end\n\n profile_id = response.body\n return profile_id\n end", "def delete_profile(profile_id)\n @type = Type::CIM_DELETE_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n redirect_to profiles_url\n end", "def destroy\n @profile = current_user.profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_path, :notice => \"profile was successfully delete.\" }\n format.json { head :no_content }\n end\n end", "def delete_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#delete_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling delete_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/delete\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#delete_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_profile_component\n @profile = Profile.find(params[:id])\n @structure_component = StructureComponent.find(@profile.structure_component_id)\n @profile.destroy\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def remove(profile)\n @repository_xml.root.delete_element(\"profile[@id='#{profile}']\")\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @users_profile = Users::Profile.find(params[:id])\n @users_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n redirect_to '/'\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n format.html { redirect_to(user_profiles_url) }\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def destroy\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n @profile_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_attributes_url) }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n end\n end", "def destroy\n @tag_pro_profile.destroy\n respond_with(@tag_pro_profile, location: root_url)\n end", "def destroy\n # @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, :notice => t('alerts.profiles.destroy') }\n format.json { head :no_content }\n end\n end", "def destroy\n raise params.inspect\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user.profile.destroy\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize @profile\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: \"Profile: #{I18n.t('helpers.deleted')}\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Profile was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n # @profile = Profile.find(params[:id])\n # authorize! :destroy, @profile\n\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pay_profile = PayProfile.find(params[:id])\n @pay_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to pay_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@profile.destroy\n\t\tset_flash_message :notice, :destroyed\n\t\tredirect_to admin_profiles_url\n\tend", "def sell_shipping_profile_delete (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.delete url, req \r\n end \r\n end", "def destroy\n @profile.destroy\n session[:profile_id] = nil\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_with(@profile)\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bprofile.destroy\n respond_to do |format|\n format.html { redirect_to bprofiles_url, notice: 'Bprofile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @climber_profile.destroy\n respond_to do |format|\n format.html { redirect_to climber_profiles_url, notice: 'Climber profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n flash[:notice] = 'Profile was successfully deleted.'\n respond_to do |format|\n format.html { redirect_to(space_user_profile_url(@space, @user)) }\n format.xml { head :ok }\n format.atom { head :ok }\n end\n end", "def delete_instance_profile(instance_profile_name)\n request(\n 'Action' => 'DeleteInstanceProfile',\n 'InstanceProfileName' => instance_profile_name,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "def destroy\n @profile = self.current_member.profile\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to current_member_profile_path }\n format.xml { head :ok }\n end\n end", "def destroy\n @private_profile = PrivateProfile.find(params[:id])\n @private_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to private_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n institution = @profile.institution\n begin\n @profile.destroy!\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Profile deleted\",\n message: \"The metadata profile \\\"#{@profile.name}\\\" has been \"\\\n \"deleted.\")\n ensure\n if current_user.sysadmin?\n redirect_to institution_path(institution)\n else\n redirect_to metadata_profiles_path\n end\n end\n end", "def remove_profile(project_root)\n # Choose a profile from the availables\n profiles = Bebox::Profile.list(project_root)\n # Get a profile if exist\n if profiles.count > 0\n profile = choose_option(profiles, _('wizard.choose_remove_profile'))\n else\n return error _('wizard.profile.no_deletion_profiles')\n end\n # Ask for deletion confirmation\n return warn(_('wizard.no_changes')) unless confirm_action?(_('wizard.profile.confirm_deletion'))\n # Profile deletion\n profile_name = profile.split('/').last\n profile_base_path = profile.split('/')[0...-1].join('/')\n profile = Bebox::Profile.new(profile_name, project_root, profile_base_path)\n output = profile.remove\n ok _('wizard.profile.deletion_success')\n return output\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: '*Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retailer_profile.destroy\n respond_to do |format|\n format.html { redirect_to retailer_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html do\n redirect_to profiles_url, notice:\n \"Profile was successfully destroyed.\"\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.73535186", "0.73372966", "0.7275864", "0.7172895", "0.70331097", "0.6998336", "0.69751936", "0.6962235", "0.6958074", "0.69547355", "0.6954444", "0.6954444", "0.6954444", "0.6952455", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6940198", "0.6940198", "0.6933357", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.6911826", "0.69048595", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.6884804", "0.6874728", "0.68729424", "0.68693346", "0.68606627", "0.6858907", "0.6854993", "0.68483496", "0.6838898", "0.6837585", "0.6834343", "0.683231", "0.6831432", "0.6830376", "0.68274814", "0.68224853", "0.68218523", "0.68218523", "0.6814163", "0.68136775", "0.68135387", "0.6811071", "0.67918175", "0.67896104", "0.67842466", "0.6783899", "0.67773455", "0.67518014", "0.6746707", "0.6732391", "0.6732391", "0.6726696", "0.6720053", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431" ]
0.67776114
66
Delete L2 Bridge Endpoint Profile API will delete L2 bridge profile with ID profileid
def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0" end # resource path local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @profile.destroy\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n end", "def delete_profile( profile_name )\n delete_all_accessors(profile_name)\n\n profile_id = find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\", { :opts => 'delete', :random => generate_random_number }\n req.headers = @authorization_headers.merge({'enctype'=>'multipart/form-data'})\n end\n\n profile_id = response.body\n return profile_id\n end", "def delete_profile(profile_id)\n @type = Type::CIM_DELETE_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n redirect_to profiles_url\n end", "def destroy\n @profile = current_user.profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_path, :notice => \"profile was successfully delete.\" }\n format.json { head :no_content }\n end\n end", "def delete_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#delete_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling delete_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/delete\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#delete_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_profile_component\n @profile = Profile.find(params[:id])\n @structure_component = StructureComponent.find(@profile.structure_component_id)\n @profile.destroy\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def remove(profile)\n @repository_xml.root.delete_element(\"profile[@id='#{profile}']\")\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @users_profile = Users::Profile.find(params[:id])\n @users_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n redirect_to '/'\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n format.html { redirect_to(user_profiles_url) }\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def delete_profile\n super\n end", "def destroy\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n @profile_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(profile_attributes_url) }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n end\n end", "def destroy\n @tag_pro_profile.destroy\n respond_with(@tag_pro_profile, location: root_url)\n end", "def destroy\n # @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, :notice => t('alerts.profiles.destroy') }\n format.json { head :no_content }\n end\n end", "def destroy\n raise params.inspect\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user.profile.destroy\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n authorize @profile\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: \"Profile: #{I18n.t('helpers.deleted')}\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Profile was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n # @profile = Profile.find(params[:id])\n # authorize! :destroy, @profile\n\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pay_profile = PayProfile.find(params[:id])\n @pay_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to pay_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\t\t@profile.destroy\n\t\tset_flash_message :notice, :destroyed\n\t\tredirect_to admin_profiles_url\n\tend", "def sell_shipping_profile_delete (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.delete url, req \r\n end \r\n end", "def destroy\n @profile.destroy\n session[:profile_id] = nil\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_with(@profile)\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bprofile.destroy\n respond_to do |format|\n format.html { redirect_to bprofiles_url, notice: 'Bprofile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @climber_profile.destroy\n respond_to do |format|\n format.html { redirect_to climber_profiles_url, notice: 'Climber profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n flash[:notice] = 'Profile was successfully deleted.'\n respond_to do |format|\n format.html { redirect_to(space_user_profile_url(@space, @user)) }\n format.xml { head :ok }\n format.atom { head :ok }\n end\n end", "def delete_instance_profile(instance_profile_name)\n request(\n 'Action' => 'DeleteInstanceProfile',\n 'InstanceProfileName' => instance_profile_name,\n :parser => Fog::Parsers::AWS::IAM::Basic.new\n )\n end", "def destroy\n @profile = self.current_member.profile\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to current_member_profile_path }\n format.xml { head :ok }\n end\n end", "def destroy\n @private_profile = PrivateProfile.find(params[:id])\n @private_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to private_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n institution = @profile.institution\n begin\n @profile.destroy!\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Profile deleted\",\n message: \"The metadata profile \\\"#{@profile.name}\\\" has been \"\\\n \"deleted.\")\n ensure\n if current_user.sysadmin?\n redirect_to institution_path(institution)\n else\n redirect_to metadata_profiles_path\n end\n end\n end", "def delete_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n nil\n end", "def remove_profile(project_root)\n # Choose a profile from the availables\n profiles = Bebox::Profile.list(project_root)\n # Get a profile if exist\n if profiles.count > 0\n profile = choose_option(profiles, _('wizard.choose_remove_profile'))\n else\n return error _('wizard.profile.no_deletion_profiles')\n end\n # Ask for deletion confirmation\n return warn(_('wizard.no_changes')) unless confirm_action?(_('wizard.profile.confirm_deletion'))\n # Profile deletion\n profile_name = profile.split('/').last\n profile_base_path = profile.split('/')[0...-1].join('/')\n profile = Bebox::Profile.new(profile_name, project_root, profile_base_path)\n output = profile.remove\n ok _('wizard.profile.deletion_success')\n return output\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_profiles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: '*Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @retailer_profile.destroy\n respond_to do |format|\n format.html { redirect_to retailer_profiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html do\n redirect_to profiles_url, notice:\n \"Profile was successfully destroyed.\"\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.73535186", "0.73372966", "0.7275864", "0.7172895", "0.70331097", "0.6998336", "0.69751936", "0.6962235", "0.6958074", "0.69547355", "0.6954444", "0.6954444", "0.6954444", "0.6952455", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6952046", "0.6940198", "0.6940198", "0.6933357", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.69279325", "0.6911826", "0.69048595", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.68858254", "0.6884804", "0.6874728", "0.68729424", "0.68693346", "0.68606627", "0.6858907", "0.6854993", "0.68483496", "0.6838898", "0.6837585", "0.6834343", "0.683231", "0.6831432", "0.6830376", "0.68274814", "0.68224853", "0.68218523", "0.68218523", "0.6814163", "0.68136775", "0.68135387", "0.6811071", "0.67918175", "0.67896104", "0.67842466", "0.6783899", "0.67776114", "0.67773455", "0.67518014", "0.6746707", "0.6732391", "0.6732391", "0.6726696", "0.6720053", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431", "0.6681431" ]
0.0
-1
List L2 Bridge Endpoint Profiles List all L2 bridge profiles
def list_l2_bridge_profiles(site_id, enforcement_point_id, opts = {}) data, _status_code, _headers = list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_app_profiles instance_id\n execute do\n instances.list_app_profiles(\n instance_path(instance_id)\n )\n end\n end", "def fetch_profiles\n UI.message \"Fetching profiles...#{Sigh.config[:app_identifier]}\"\n results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier])\n\n #Take the provisioning profile name into account\n #if Sigh.config[:provisioning_name].to_s.length > 0\n #filtered = results.select { |p| p.name.strip == Sigh.config[:provisioning_name].strip }\n #if Sigh.config[:ignore_profiles_with_different_name]\n #results = filtered\n #else\n #results = filtered if (filtered || []).count > 0\n #end\n #end\n\n if results \n return [results]\n else\n return []\n end\n \n\n\n #return results if Sigh.config[:skip_certificate_verification]\n\n #return results.find_all do |a|\n ## Also make sure we have the certificate installed on the local machine\n #installed = false\n #a.certificates.each do |cert|\n #file = Tempfile.new('cert')\n #file.write(cert.download_raw)\n #file.close\n #installed = true if FastlaneCore::CertChecker.installed?(file.path)\n #end\n #installed\n #end\n end", "def list_app_profiles instance_id\n instances.list_app_profiles parent: instance_path(instance_id)\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'list', 'KalturaPaymentGatewayProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'list', 'KalturaOSSAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdvradapterprofile', 'list', 'KalturaCDVRAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def all_profiles(property_hash)\n profiles = []\n\n client = property_hash[:protocol_profile_client] || property_hash[:protocol_profile_server]\n server = property_hash[:protocol_profile_server] || property_hash[:protocol_profile_client]\n if !client.nil?\n if client == server\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_ALL\" }\n else\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_CLIENT\" }\n profiles << { :profile_name => server,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_SERVER\" }\n end\n end\n\n (profile_properties - [:protocol_profile_client,\n :protocol_profile_server]).each do |propertyname|\n property_hash[propertyname].nil? && next\n type, context = /^([^_]+)_PROFILES?_?([^_]+)?$/.match(\n propertyname.upcase).captures\n context = context || \"ALL\"\n\n typemap = {\n 'SIP' => 'SIPP',\n 'ONECONNECT' => 'CONNECTION_POOL'\n }\n type = typemap[type] || type\n\n profile_type = context == \"ALL\" ?\n \"PROFILE_TYPE_#{type}\" :\n \"PROFILE_TYPE_#{context}_#{type}\"\n profile_context = \"PROFILE_CONTEXT_TYPE_#{context}\"\n arraywrap(property_hash[propertyname]).each do |profile_name|\n profiles << { profile_name: profile_name,\n profile_type: profile_type,\n profile_context: profile_context }\n end\n end\n profiles\n end", "def list_instance_profiles(options={})\n request({\n 'Action' => 'ListInstanceProfiles',\n :parser => Fog::Parsers::AWS::IAM::ListInstanceProfiles.new\n }.merge!(options))\n end", "def profiles\n Management::Profile.all(self)\n end", "def list_ipfixl2_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_with_http_info(opts)\n data\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def profiles; end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def profiles\n collection(\"profiles\", paged: true)\n end", "def profile_urls\n Enceladus::Configuration::Image.instance.url_for(\"profile\", profile_path)\n end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def bridges_list\n get \"bridges\"\n end", "def profiles(fields: nil)\n params = build_fields_params fields\n res = @connection.get profile_path, params\n map_as_collection res, Profile\n end", "def index\n @profiles = current_user.profiles\n end", "def index\n @profiles = current_user.profiles\n end", "def list_l2_bridge_profiles_0(site_id, enforcement_point_id, opts = {})\n data, _status_code, _headers = list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts)\n data\n end", "def list_ipfixl2_collector_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_with_http_info(opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def index\n @partner_profiles = PartnerProfile.all\n end", "def list_ipfixl2_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_0_with_http_info(opts)\n data\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdnadapterprofile', 'list', 'KalturaCDNAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def pull_profiles\n \tprofiles_from_api = self.client.profiles\n\t\tprofiles_array = []\n\t\tprofiles_from_api.each do |p|\n\t\t\tif p.service == \"twitter\"\n\t\t\t\tprofiles_array << p\n\t\t\tend\n\t\tend\n\t\tprofiles_array\n end", "def load_profiles()\n # read profiles\n puts \"Loading configs from #{@server_host}:#{@server_port}\" # Rails.logger.info\n\n res = Net::HTTP.start(@server_host, @server_port) {|http|\n http.open_timeout = 5\n http.read_timeout = 10\n http.get('/api/profiles')\n }\n raise \"HTTP status is not succeeded\" if res.code != '200'\n\n profiles_arr = JSON.parse(res.body)\n @table = ProfileTable.new(profiles_arr)\n end", "def list_arrays_assigned_to_profile(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/arrays\", args)\nend", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('externalchannelprofile', 'list', 'KalturaExternalChannelProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def index\n @client_profiles = ClientProfile.all\n end", "def all\n @available_profiles ||= yaml_config['profiles'].map(&:first)\n end", "def list_ipfixl2_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cap_ids\n CAP_CLIENT.profile_ids\nend", "def index\n @climber_profiles = ClimberProfile.all\n end", "def profile_urls\n [profile_url].compact\n end", "def index\n @gear_profiles = GearProfile.all\n end", "def profile_setting_list\n\t\t# find the home address\n\t\t@home_addresses = @profile_setting.addresses.where(address_type: \"home\")\n\tend", "def profiles\n @profiles.sort_by(&:name)\n end", "def chargeable_profiles\n profile ? [profile] : []\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def list\n display \"Available rsync backup profiles:\"\n\n profiles = _profiles\n\n if profiles.blank?\n return []\n end\n\n profiles.each do |profile|\n display profile['name']\n end\n\n return profiles\n end", "def list_ipfixl2_collector_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_0_with_http_info(opts)\n data\n end", "def show\n @member = Member.find(params[:id], :include=>:profiles)\n\n @user_profiles = @member.profiles.map{|p|{p.network_id=>p.url}}\n @pro_networks = Network.with_urls(@user_profiles, :pro)\n @perso_networks = Network.with_urls(@user_profiles, :perso)\n\n end", "def index\n @retailer_profiles = RetailerProfile.all\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def index\n @professional_profiles = ProfessionalProfile.all\n end", "def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end", "def index\n @driver_profiles = DriverProfile.all\n end", "def index\n @bprofiles = Bprofile.all\n end", "def profiles\n ####\n #puts self.to_xml\n #puts self.to_xml\n @profs ||= long_function\n return @profs\n end", "def users\n res = []\n url = data['links']['roleUsers']\n tmp = GoodData.get url\n tmp['associatedUsers']['users'].each do |user_url|\n user = GoodData.get user_url\n res << GoodData::Profile.new(user)\n end\n res\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def index\n @admin_profiles = Admin::Profile.all\n end", "def index\n @seeker_profiles = SeekerProfile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def list_ipfixl2_profiles_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('deliveryprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def index\r\n @profiles = Profile.all\r\n end", "def index\r\n @profiles = Profile.all\r\n end", "def show\n @profiles = @grab.profiles\n end", "def active_profiles\n profiles.select {|p| p.active?}\n end", "def index\n @profiles = Profile.all\n\n end", "def multi_config\n if profiles.is_a?(Hash)\n profiles\n elsif profiles.is_a?(Array)\n {}.tap do |p|\n for name in profiles\n p[name] = available[name] ||\n raise(ProfileError, \"Profile #{name.inspect} is undefined\")\n end\n end\n end\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def index\n @profiles = Profile.all\n end", "def index\n @general_profiles = GeneralProfile.all\n end", "def list_ipfixl2_collector_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#list_ipfixl2_collector_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints_list\n get \"endpoints\"\n end", "def index\n @userprofiles = Userprofile.all\n end", "def security_profiles(user_email)\n @json_client.security_profiles(user_email)[\"security_profiles\"].map {|s| SecurityProfile.new(s) }\n end", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def profiles\n iam_profiles = find_profiles(/^aws_access_key_id/)\n mfa_profiles = find_profiles(/^mfa_serial/)\n iam_profiles - mfa_profiles\n end", "def index \n @profiles = Profile.all\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def switch_profiles\r\n SwitchProfilesController.instance\r\n end", "def index\n authorize MetadataProfile\n @profiles = MetadataProfile.\n where(institution: current_institution).\n order(:name)\n end", "def index\n @project_profiles = ProjectProfile.all\n end" ]
[ "0.622121", "0.6171837", "0.613318", "0.61215836", "0.6089443", "0.6062317", "0.5965883", "0.59603125", "0.59340954", "0.59097725", "0.58970654", "0.5877867", "0.5876824", "0.5838917", "0.5827292", "0.58270675", "0.5821021", "0.57649034", "0.5748111", "0.5683791", "0.56539446", "0.56539446", "0.5637352", "0.56327504", "0.56300867", "0.5627018", "0.56139046", "0.56066656", "0.5593972", "0.55897546", "0.55462974", "0.553995", "0.54824203", "0.5464241", "0.54325986", "0.54269886", "0.5426108", "0.5406748", "0.53967965", "0.5381679", "0.5378894", "0.53758746", "0.536964", "0.5368929", "0.53688425", "0.53561264", "0.5325822", "0.5325195", "0.531943", "0.5298061", "0.52951443", "0.5294908", "0.5290362", "0.5279424", "0.5275617", "0.5273647", "0.52590764", "0.5250606", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52237386", "0.5215279", "0.52116513", "0.5209363", "0.5197582", "0.5197582", "0.51946235", "0.51914895", "0.5172924", "0.5170707", "0.5168221", "0.5157614", "0.515415", "0.5146263", "0.51459557", "0.5142806", "0.5141865", "0.5136492", "0.51348025", "0.5133034", "0.5129745", "0.5112771", "0.509192", "0.5085914", "0.5082521", "0.50818276" ]
0.610758
4
List L2 Bridge Endpoint Profiles List all L2 bridge profiles
def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.' end # resource path local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'L2BridgeEndpointProfileListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_app_profiles instance_id\n execute do\n instances.list_app_profiles(\n instance_path(instance_id)\n )\n end\n end", "def fetch_profiles\n UI.message \"Fetching profiles...#{Sigh.config[:app_identifier]}\"\n results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier])\n\n #Take the provisioning profile name into account\n #if Sigh.config[:provisioning_name].to_s.length > 0\n #filtered = results.select { |p| p.name.strip == Sigh.config[:provisioning_name].strip }\n #if Sigh.config[:ignore_profiles_with_different_name]\n #results = filtered\n #else\n #results = filtered if (filtered || []).count > 0\n #end\n #end\n\n if results \n return [results]\n else\n return []\n end\n \n\n\n #return results if Sigh.config[:skip_certificate_verification]\n\n #return results.find_all do |a|\n ## Also make sure we have the certificate installed on the local machine\n #installed = false\n #a.certificates.each do |cert|\n #file = Tempfile.new('cert')\n #file.write(cert.download_raw)\n #file.close\n #installed = true if FastlaneCore::CertChecker.installed?(file.path)\n #end\n #installed\n #end\n end", "def list_app_profiles instance_id\n instances.list_app_profiles parent: instance_path(instance_id)\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'list', 'KalturaPaymentGatewayProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def list_l2_bridge_profiles(site_id, enforcement_point_id, opts = {})\n data, _status_code, _headers = list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts)\n data\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'list', 'KalturaOSSAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdvradapterprofile', 'list', 'KalturaCDVRAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def all_profiles(property_hash)\n profiles = []\n\n client = property_hash[:protocol_profile_client] || property_hash[:protocol_profile_server]\n server = property_hash[:protocol_profile_server] || property_hash[:protocol_profile_client]\n if !client.nil?\n if client == server\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_ALL\" }\n else\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_CLIENT\" }\n profiles << { :profile_name => server,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_SERVER\" }\n end\n end\n\n (profile_properties - [:protocol_profile_client,\n :protocol_profile_server]).each do |propertyname|\n property_hash[propertyname].nil? && next\n type, context = /^([^_]+)_PROFILES?_?([^_]+)?$/.match(\n propertyname.upcase).captures\n context = context || \"ALL\"\n\n typemap = {\n 'SIP' => 'SIPP',\n 'ONECONNECT' => 'CONNECTION_POOL'\n }\n type = typemap[type] || type\n\n profile_type = context == \"ALL\" ?\n \"PROFILE_TYPE_#{type}\" :\n \"PROFILE_TYPE_#{context}_#{type}\"\n profile_context = \"PROFILE_CONTEXT_TYPE_#{context}\"\n arraywrap(property_hash[propertyname]).each do |profile_name|\n profiles << { profile_name: profile_name,\n profile_type: profile_type,\n profile_context: profile_context }\n end\n end\n profiles\n end", "def list_instance_profiles(options={})\n request({\n 'Action' => 'ListInstanceProfiles',\n :parser => Fog::Parsers::AWS::IAM::ListInstanceProfiles.new\n }.merge!(options))\n end", "def profiles\n Management::Profile.all(self)\n end", "def list_ipfixl2_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_with_http_info(opts)\n data\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def profiles; end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def profiles\n collection(\"profiles\", paged: true)\n end", "def profile_urls\n Enceladus::Configuration::Image.instance.url_for(\"profile\", profile_path)\n end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def bridges_list\n get \"bridges\"\n end", "def profiles(fields: nil)\n params = build_fields_params fields\n res = @connection.get profile_path, params\n map_as_collection res, Profile\n end", "def index\n @profiles = current_user.profiles\n end", "def index\n @profiles = current_user.profiles\n end", "def list_l2_bridge_profiles_0(site_id, enforcement_point_id, opts = {})\n data, _status_code, _headers = list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts)\n data\n end", "def list_ipfixl2_collector_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_with_http_info(opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def index\n @partner_profiles = PartnerProfile.all\n end", "def list_ipfixl2_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_0_with_http_info(opts)\n data\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdnadapterprofile', 'list', 'KalturaCDNAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def pull_profiles\n \tprofiles_from_api = self.client.profiles\n\t\tprofiles_array = []\n\t\tprofiles_from_api.each do |p|\n\t\t\tif p.service == \"twitter\"\n\t\t\t\tprofiles_array << p\n\t\t\tend\n\t\tend\n\t\tprofiles_array\n end", "def load_profiles()\n # read profiles\n puts \"Loading configs from #{@server_host}:#{@server_port}\" # Rails.logger.info\n\n res = Net::HTTP.start(@server_host, @server_port) {|http|\n http.open_timeout = 5\n http.read_timeout = 10\n http.get('/api/profiles')\n }\n raise \"HTTP status is not succeeded\" if res.code != '200'\n\n profiles_arr = JSON.parse(res.body)\n @table = ProfileTable.new(profiles_arr)\n end", "def list_arrays_assigned_to_profile(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/arrays\", args)\nend", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('externalchannelprofile', 'list', 'KalturaExternalChannelProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def index\n @client_profiles = ClientProfile.all\n end", "def all\n @available_profiles ||= yaml_config['profiles'].map(&:first)\n end", "def list_ipfixl2_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cap_ids\n CAP_CLIENT.profile_ids\nend", "def index\n @climber_profiles = ClimberProfile.all\n end", "def profile_urls\n [profile_url].compact\n end", "def index\n @gear_profiles = GearProfile.all\n end", "def profile_setting_list\n\t\t# find the home address\n\t\t@home_addresses = @profile_setting.addresses.where(address_type: \"home\")\n\tend", "def profiles\n @profiles.sort_by(&:name)\n end", "def chargeable_profiles\n profile ? [profile] : []\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def list\n display \"Available rsync backup profiles:\"\n\n profiles = _profiles\n\n if profiles.blank?\n return []\n end\n\n profiles.each do |profile|\n display profile['name']\n end\n\n return profiles\n end", "def list_ipfixl2_collector_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_0_with_http_info(opts)\n data\n end", "def show\n @member = Member.find(params[:id], :include=>:profiles)\n\n @user_profiles = @member.profiles.map{|p|{p.network_id=>p.url}}\n @pro_networks = Network.with_urls(@user_profiles, :pro)\n @perso_networks = Network.with_urls(@user_profiles, :perso)\n\n end", "def index\n @retailer_profiles = RetailerProfile.all\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def index\n @professional_profiles = ProfessionalProfile.all\n end", "def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end", "def index\n @driver_profiles = DriverProfile.all\n end", "def index\n @bprofiles = Bprofile.all\n end", "def profiles\n ####\n #puts self.to_xml\n #puts self.to_xml\n @profs ||= long_function\n return @profs\n end", "def users\n res = []\n url = data['links']['roleUsers']\n tmp = GoodData.get url\n tmp['associatedUsers']['users'].each do |user_url|\n user = GoodData.get user_url\n res << GoodData::Profile.new(user)\n end\n res\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def index\n @admin_profiles = Admin::Profile.all\n end", "def index\n @seeker_profiles = SeekerProfile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def list_ipfixl2_profiles_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('deliveryprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def index\r\n @profiles = Profile.all\r\n end", "def index\r\n @profiles = Profile.all\r\n end", "def show\n @profiles = @grab.profiles\n end", "def active_profiles\n profiles.select {|p| p.active?}\n end", "def index\n @profiles = Profile.all\n\n end", "def multi_config\n if profiles.is_a?(Hash)\n profiles\n elsif profiles.is_a?(Array)\n {}.tap do |p|\n for name in profiles\n p[name] = available[name] ||\n raise(ProfileError, \"Profile #{name.inspect} is undefined\")\n end\n end\n end\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def index\n @profiles = Profile.all\n end", "def index\n @general_profiles = GeneralProfile.all\n end", "def list_ipfixl2_collector_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#list_ipfixl2_collector_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints_list\n get \"endpoints\"\n end", "def index\n @userprofiles = Userprofile.all\n end", "def security_profiles(user_email)\n @json_client.security_profiles(user_email)[\"security_profiles\"].map {|s| SecurityProfile.new(s) }\n end", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def profiles\n iam_profiles = find_profiles(/^aws_access_key_id/)\n mfa_profiles = find_profiles(/^mfa_serial/)\n iam_profiles - mfa_profiles\n end", "def index \n @profiles = Profile.all\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def switch_profiles\r\n SwitchProfilesController.instance\r\n end", "def index\n authorize MetadataProfile\n @profiles = MetadataProfile.\n where(institution: current_institution).\n order(:name)\n end", "def index\n @project_profiles = ProjectProfile.all\n end" ]
[ "0.622121", "0.6171837", "0.613318", "0.61215836", "0.610758", "0.6089443", "0.6062317", "0.5965883", "0.59603125", "0.59340954", "0.59097725", "0.58970654", "0.5877867", "0.5876824", "0.5838917", "0.5827292", "0.58270675", "0.5821021", "0.5748111", "0.5683791", "0.56539446", "0.56539446", "0.5637352", "0.56327504", "0.56300867", "0.5627018", "0.56139046", "0.56066656", "0.5593972", "0.55897546", "0.55462974", "0.553995", "0.54824203", "0.5464241", "0.54325986", "0.54269886", "0.5426108", "0.5406748", "0.53967965", "0.5381679", "0.5378894", "0.53758746", "0.536964", "0.5368929", "0.53688425", "0.53561264", "0.5325822", "0.5325195", "0.531943", "0.5298061", "0.52951443", "0.5294908", "0.5290362", "0.5279424", "0.5275617", "0.5273647", "0.52590764", "0.5250606", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52237386", "0.5215279", "0.52116513", "0.5209363", "0.5197582", "0.5197582", "0.51946235", "0.51914895", "0.5172924", "0.5170707", "0.5168221", "0.5157614", "0.515415", "0.5146263", "0.51459557", "0.5142806", "0.5141865", "0.5136492", "0.51348025", "0.5133034", "0.5129745", "0.5112771", "0.509192", "0.5085914", "0.5082521", "0.50818276" ]
0.57649034
18
List L2 Bridge Endpoint Profiles List all L2 bridge profiles
def list_l2_bridge_profiles_0(site_id, enforcement_point_id, opts = {}) data, _status_code, _headers = list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_app_profiles instance_id\n execute do\n instances.list_app_profiles(\n instance_path(instance_id)\n )\n end\n end", "def fetch_profiles\n UI.message \"Fetching profiles...#{Sigh.config[:app_identifier]}\"\n results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier])\n\n #Take the provisioning profile name into account\n #if Sigh.config[:provisioning_name].to_s.length > 0\n #filtered = results.select { |p| p.name.strip == Sigh.config[:provisioning_name].strip }\n #if Sigh.config[:ignore_profiles_with_different_name]\n #results = filtered\n #else\n #results = filtered if (filtered || []).count > 0\n #end\n #end\n\n if results \n return [results]\n else\n return []\n end\n \n\n\n #return results if Sigh.config[:skip_certificate_verification]\n\n #return results.find_all do |a|\n ## Also make sure we have the certificate installed on the local machine\n #installed = false\n #a.certificates.each do |cert|\n #file = Tempfile.new('cert')\n #file.write(cert.download_raw)\n #file.close\n #installed = true if FastlaneCore::CertChecker.installed?(file.path)\n #end\n #installed\n #end\n end", "def list_app_profiles instance_id\n instances.list_app_profiles parent: instance_path(instance_id)\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'list', 'KalturaPaymentGatewayProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def list_l2_bridge_profiles(site_id, enforcement_point_id, opts = {})\n data, _status_code, _headers = list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts)\n data\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'list', 'KalturaOSSAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdvradapterprofile', 'list', 'KalturaCDVRAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def all_profiles(property_hash)\n profiles = []\n\n client = property_hash[:protocol_profile_client] || property_hash[:protocol_profile_server]\n server = property_hash[:protocol_profile_server] || property_hash[:protocol_profile_client]\n if !client.nil?\n if client == server\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_ALL\" }\n else\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_CLIENT\" }\n profiles << { :profile_name => server,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_SERVER\" }\n end\n end\n\n (profile_properties - [:protocol_profile_client,\n :protocol_profile_server]).each do |propertyname|\n property_hash[propertyname].nil? && next\n type, context = /^([^_]+)_PROFILES?_?([^_]+)?$/.match(\n propertyname.upcase).captures\n context = context || \"ALL\"\n\n typemap = {\n 'SIP' => 'SIPP',\n 'ONECONNECT' => 'CONNECTION_POOL'\n }\n type = typemap[type] || type\n\n profile_type = context == \"ALL\" ?\n \"PROFILE_TYPE_#{type}\" :\n \"PROFILE_TYPE_#{context}_#{type}\"\n profile_context = \"PROFILE_CONTEXT_TYPE_#{context}\"\n arraywrap(property_hash[propertyname]).each do |profile_name|\n profiles << { profile_name: profile_name,\n profile_type: profile_type,\n profile_context: profile_context }\n end\n end\n profiles\n end", "def list_instance_profiles(options={})\n request({\n 'Action' => 'ListInstanceProfiles',\n :parser => Fog::Parsers::AWS::IAM::ListInstanceProfiles.new\n }.merge!(options))\n end", "def profiles\n Management::Profile.all(self)\n end", "def list_ipfixl2_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_with_http_info(opts)\n data\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def profiles; end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def profiles\n collection(\"profiles\", paged: true)\n end", "def profile_urls\n Enceladus::Configuration::Image.instance.url_for(\"profile\", profile_path)\n end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def bridges_list\n get \"bridges\"\n end", "def profiles(fields: nil)\n params = build_fields_params fields\n res = @connection.get profile_path, params\n map_as_collection res, Profile\n end", "def index\n @profiles = current_user.profiles\n end", "def index\n @profiles = current_user.profiles\n end", "def list_ipfixl2_collector_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_with_http_info(opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def index\n @partner_profiles = PartnerProfile.all\n end", "def list_ipfixl2_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_0_with_http_info(opts)\n data\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdnadapterprofile', 'list', 'KalturaCDNAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def pull_profiles\n \tprofiles_from_api = self.client.profiles\n\t\tprofiles_array = []\n\t\tprofiles_from_api.each do |p|\n\t\t\tif p.service == \"twitter\"\n\t\t\t\tprofiles_array << p\n\t\t\tend\n\t\tend\n\t\tprofiles_array\n end", "def load_profiles()\n # read profiles\n puts \"Loading configs from #{@server_host}:#{@server_port}\" # Rails.logger.info\n\n res = Net::HTTP.start(@server_host, @server_port) {|http|\n http.open_timeout = 5\n http.read_timeout = 10\n http.get('/api/profiles')\n }\n raise \"HTTP status is not succeeded\" if res.code != '200'\n\n profiles_arr = JSON.parse(res.body)\n @table = ProfileTable.new(profiles_arr)\n end", "def list_arrays_assigned_to_profile(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/arrays\", args)\nend", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('externalchannelprofile', 'list', 'KalturaExternalChannelProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def index\n @client_profiles = ClientProfile.all\n end", "def all\n @available_profiles ||= yaml_config['profiles'].map(&:first)\n end", "def list_ipfixl2_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cap_ids\n CAP_CLIENT.profile_ids\nend", "def index\n @climber_profiles = ClimberProfile.all\n end", "def profile_urls\n [profile_url].compact\n end", "def index\n @gear_profiles = GearProfile.all\n end", "def profile_setting_list\n\t\t# find the home address\n\t\t@home_addresses = @profile_setting.addresses.where(address_type: \"home\")\n\tend", "def profiles\n @profiles.sort_by(&:name)\n end", "def chargeable_profiles\n profile ? [profile] : []\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def list\n display \"Available rsync backup profiles:\"\n\n profiles = _profiles\n\n if profiles.blank?\n return []\n end\n\n profiles.each do |profile|\n display profile['name']\n end\n\n return profiles\n end", "def list_ipfixl2_collector_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_0_with_http_info(opts)\n data\n end", "def show\n @member = Member.find(params[:id], :include=>:profiles)\n\n @user_profiles = @member.profiles.map{|p|{p.network_id=>p.url}}\n @pro_networks = Network.with_urls(@user_profiles, :pro)\n @perso_networks = Network.with_urls(@user_profiles, :perso)\n\n end", "def index\n @retailer_profiles = RetailerProfile.all\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def index\n @professional_profiles = ProfessionalProfile.all\n end", "def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end", "def index\n @driver_profiles = DriverProfile.all\n end", "def index\n @bprofiles = Bprofile.all\n end", "def profiles\n ####\n #puts self.to_xml\n #puts self.to_xml\n @profs ||= long_function\n return @profs\n end", "def users\n res = []\n url = data['links']['roleUsers']\n tmp = GoodData.get url\n tmp['associatedUsers']['users'].each do |user_url|\n user = GoodData.get user_url\n res << GoodData::Profile.new(user)\n end\n res\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def index\n @admin_profiles = Admin::Profile.all\n end", "def index\n @seeker_profiles = SeekerProfile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def list_ipfixl2_profiles_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('deliveryprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def index\r\n @profiles = Profile.all\r\n end", "def index\r\n @profiles = Profile.all\r\n end", "def show\n @profiles = @grab.profiles\n end", "def active_profiles\n profiles.select {|p| p.active?}\n end", "def index\n @profiles = Profile.all\n\n end", "def multi_config\n if profiles.is_a?(Hash)\n profiles\n elsif profiles.is_a?(Array)\n {}.tap do |p|\n for name in profiles\n p[name] = available[name] ||\n raise(ProfileError, \"Profile #{name.inspect} is undefined\")\n end\n end\n end\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def index\n @profiles = Profile.all\n end", "def index\n @general_profiles = GeneralProfile.all\n end", "def list_ipfixl2_collector_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#list_ipfixl2_collector_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints_list\n get \"endpoints\"\n end", "def index\n @userprofiles = Userprofile.all\n end", "def security_profiles(user_email)\n @json_client.security_profiles(user_email)[\"security_profiles\"].map {|s| SecurityProfile.new(s) }\n end", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def profiles\n iam_profiles = find_profiles(/^aws_access_key_id/)\n mfa_profiles = find_profiles(/^mfa_serial/)\n iam_profiles - mfa_profiles\n end", "def index \n @profiles = Profile.all\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def switch_profiles\r\n SwitchProfilesController.instance\r\n end", "def index\n authorize MetadataProfile\n @profiles = MetadataProfile.\n where(institution: current_institution).\n order(:name)\n end", "def index\n @project_profiles = ProjectProfile.all\n end" ]
[ "0.622121", "0.6171837", "0.613318", "0.61215836", "0.610758", "0.6089443", "0.6062317", "0.5965883", "0.59603125", "0.59340954", "0.59097725", "0.58970654", "0.5877867", "0.5876824", "0.5838917", "0.5827292", "0.58270675", "0.5821021", "0.57649034", "0.5748111", "0.5683791", "0.56539446", "0.56539446", "0.56327504", "0.56300867", "0.5627018", "0.56139046", "0.56066656", "0.5593972", "0.55897546", "0.55462974", "0.553995", "0.54824203", "0.5464241", "0.54325986", "0.54269886", "0.5426108", "0.5406748", "0.53967965", "0.5381679", "0.5378894", "0.53758746", "0.536964", "0.5368929", "0.53688425", "0.53561264", "0.5325822", "0.5325195", "0.531943", "0.5298061", "0.52951443", "0.5294908", "0.5290362", "0.5279424", "0.5275617", "0.5273647", "0.52590764", "0.5250606", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52237386", "0.5215279", "0.52116513", "0.5209363", "0.5197582", "0.5197582", "0.51946235", "0.51914895", "0.5172924", "0.5170707", "0.5168221", "0.5157614", "0.515415", "0.5146263", "0.51459557", "0.5142806", "0.5141865", "0.5136492", "0.51348025", "0.5133034", "0.5129745", "0.5112771", "0.509192", "0.5085914", "0.5082521", "0.50818276" ]
0.5637352
23
List L2 Bridge Endpoint Profiles List all L2 bridge profiles
def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0" end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.' end # resource path local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s) # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'L2BridgeEndpointProfileListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_app_profiles instance_id\n execute do\n instances.list_app_profiles(\n instance_path(instance_id)\n )\n end\n end", "def fetch_profiles\n UI.message \"Fetching profiles...#{Sigh.config[:app_identifier]}\"\n results = profile_type.find_by_bundle_id(Sigh.config[:app_identifier])\n\n #Take the provisioning profile name into account\n #if Sigh.config[:provisioning_name].to_s.length > 0\n #filtered = results.select { |p| p.name.strip == Sigh.config[:provisioning_name].strip }\n #if Sigh.config[:ignore_profiles_with_different_name]\n #results = filtered\n #else\n #results = filtered if (filtered || []).count > 0\n #end\n #end\n\n if results \n return [results]\n else\n return []\n end\n \n\n\n #return results if Sigh.config[:skip_certificate_verification]\n\n #return results.find_all do |a|\n ## Also make sure we have the certificate installed on the local machine\n #installed = false\n #a.certificates.each do |cert|\n #file = Tempfile.new('cert')\n #file.write(cert.download_raw)\n #file.close\n #installed = true if FastlaneCore::CertChecker.installed?(file.path)\n #end\n #installed\n #end\n end", "def list_app_profiles instance_id\n instances.list_app_profiles parent: instance_path(instance_id)\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'list', 'KalturaPaymentGatewayProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def list_l2_bridge_profiles(site_id, enforcement_point_id, opts = {})\n data, _status_code, _headers = list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts)\n data\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'list', 'KalturaOSSAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdvradapterprofile', 'list', 'KalturaCDVRAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def all_profiles(property_hash)\n profiles = []\n\n client = property_hash[:protocol_profile_client] || property_hash[:protocol_profile_server]\n server = property_hash[:protocol_profile_server] || property_hash[:protocol_profile_client]\n if !client.nil?\n if client == server\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_ALL\" }\n else\n profiles << { :profile_name => client,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_CLIENT\" }\n profiles << { :profile_name => server,\n :profile_type => nil,\n :profile_context => \"PROFILE_CONTEXT_TYPE_SERVER\" }\n end\n end\n\n (profile_properties - [:protocol_profile_client,\n :protocol_profile_server]).each do |propertyname|\n property_hash[propertyname].nil? && next\n type, context = /^([^_]+)_PROFILES?_?([^_]+)?$/.match(\n propertyname.upcase).captures\n context = context || \"ALL\"\n\n typemap = {\n 'SIP' => 'SIPP',\n 'ONECONNECT' => 'CONNECTION_POOL'\n }\n type = typemap[type] || type\n\n profile_type = context == \"ALL\" ?\n \"PROFILE_TYPE_#{type}\" :\n \"PROFILE_TYPE_#{context}_#{type}\"\n profile_context = \"PROFILE_CONTEXT_TYPE_#{context}\"\n arraywrap(property_hash[propertyname]).each do |profile_name|\n profiles << { profile_name: profile_name,\n profile_type: profile_type,\n profile_context: profile_context }\n end\n end\n profiles\n end", "def list_instance_profiles(options={})\n request({\n 'Action' => 'ListInstanceProfiles',\n :parser => Fog::Parsers::AWS::IAM::ListInstanceProfiles.new\n }.merge!(options))\n end", "def profiles\n Management::Profile.all(self)\n end", "def list_ipfixl2_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_with_http_info(opts)\n data\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def profiles; end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def profiles\n collection(\"profiles\", paged: true)\n end", "def profile_urls\n Enceladus::Configuration::Image.instance.url_for(\"profile\", profile_path)\n end", "def list_connection_profiles request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_connection_profiles_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def bridges_list\n get \"bridges\"\n end", "def profiles(fields: nil)\n params = build_fields_params fields\n res = @connection.get profile_path, params\n map_as_collection res, Profile\n end", "def index\n @profiles = current_user.profiles\n end", "def index\n @profiles = current_user.profiles\n end", "def list_l2_bridge_profiles_0(site_id, enforcement_point_id, opts = {})\n data, _status_code, _headers = list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts)\n data\n end", "def list_ipfixl2_collector_profiles(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_with_http_info(opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def index\n @partner_profiles = PartnerProfile.all\n end", "def list_ipfixl2_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_profiles_0_with_http_info(opts)\n data\n end", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('cdnadapterprofile', 'list', 'KalturaCDNAdapterProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def pull_profiles\n \tprofiles_from_api = self.client.profiles\n\t\tprofiles_array = []\n\t\tprofiles_from_api.each do |p|\n\t\t\tif p.service == \"twitter\"\n\t\t\t\tprofiles_array << p\n\t\t\tend\n\t\tend\n\t\tprofiles_array\n end", "def load_profiles()\n # read profiles\n puts \"Loading configs from #{@server_host}:#{@server_port}\" # Rails.logger.info\n\n res = Net::HTTP.start(@server_host, @server_port) {|http|\n http.open_timeout = 5\n http.read_timeout = 10\n http.get('/api/profiles')\n }\n raise \"HTTP status is not succeeded\" if res.code != '200'\n\n profiles_arr = JSON.parse(res.body)\n @table = ProfileTable.new(profiles_arr)\n end", "def list_arrays_assigned_to_profile(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/arrays\", args)\nend", "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('externalchannelprofile', 'list', 'KalturaExternalChannelProfileListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def index\n @client_profiles = ClientProfile.all\n end", "def all\n @available_profiles ||= yaml_config['profiles'].map(&:first)\n end", "def list_ipfixl2_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def cap_ids\n CAP_CLIENT.profile_ids\nend", "def index\n @climber_profiles = ClimberProfile.all\n end", "def profile_urls\n [profile_url].compact\n end", "def index\n @gear_profiles = GearProfile.all\n end", "def profile_setting_list\n\t\t# find the home address\n\t\t@home_addresses = @profile_setting.addresses.where(address_type: \"home\")\n\tend", "def profiles\n @profiles.sort_by(&:name)\n end", "def chargeable_profiles\n profile ? [profile] : []\n end", "def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end", "def list\n display \"Available rsync backup profiles:\"\n\n profiles = _profiles\n\n if profiles.blank?\n return []\n end\n\n profiles.each do |profile|\n display profile['name']\n end\n\n return profiles\n end", "def list_ipfixl2_collector_profiles_0(opts = {})\n data, _status_code, _headers = list_ipfixl2_collector_profiles_0_with_http_info(opts)\n data\n end", "def show\n @member = Member.find(params[:id], :include=>:profiles)\n\n @user_profiles = @member.profiles.map{|p|{p.network_id=>p.url}}\n @pro_networks = Network.with_urls(@user_profiles, :pro)\n @perso_networks = Network.with_urls(@user_profiles, :perso)\n\n end", "def index\n @retailer_profiles = RetailerProfile.all\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def index\n @professional_profiles = ProfessionalProfile.all\n end", "def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end", "def index\n @driver_profiles = DriverProfile.all\n end", "def index\n @bprofiles = Bprofile.all\n end", "def profiles\n ####\n #puts self.to_xml\n #puts self.to_xml\n @profs ||= long_function\n return @profs\n end", "def users\n res = []\n url = data['links']['roleUsers']\n tmp = GoodData.get url\n tmp['associatedUsers']['users'].each do |user_url|\n user = GoodData.get user_url\n res << GoodData::Profile.new(user)\n end\n res\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def index\n @admin_profiles = Admin::Profile.all\n end", "def index\n @seeker_profiles = SeekerProfile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def index\n @profiles = Profile.all\n end", "def list_ipfixl2_profiles_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.list_ipfixl2_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2ProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#list_ipfixl2_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('deliveryprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'filter', filter);\n\t\t\tclient.add_param(kparams, 'pager', pager);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'list', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def index\r\n @profiles = Profile.all\r\n end", "def index\r\n @profiles = Profile.all\r\n end", "def show\n @profiles = @grab.profiles\n end", "def active_profiles\n profiles.select {|p| p.active?}\n end", "def index\n @profiles = Profile.all\n\n end", "def multi_config\n if profiles.is_a?(Hash)\n profiles\n elsif profiles.is_a?(Array)\n {}.tap do |p|\n for name in profiles\n p[name] = available[name] ||\n raise(ProfileError, \"Profile #{name.inspect} is undefined\")\n end\n end\n end\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def index\n @profiles = Profile.all\n end", "def index\n @general_profiles = GeneralProfile.all\n end", "def list_ipfixl2_collector_profiles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.list_ipfixl2_collector_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#list_ipfixl2_collector_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def endpoints_list\n get \"endpoints\"\n end", "def index\n @userprofiles = Userprofile.all\n end", "def security_profiles(user_email)\n @json_client.security_profiles(user_email)[\"security_profiles\"].map {|s| SecurityProfile.new(s) }\n end", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def profiles\n iam_profiles = find_profiles(/^aws_access_key_id/)\n mfa_profiles = find_profiles(/^mfa_serial/)\n iam_profiles - mfa_profiles\n end", "def index \n @profiles = Profile.all\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def switch_profiles\r\n SwitchProfilesController.instance\r\n end", "def index\n authorize MetadataProfile\n @profiles = MetadataProfile.\n where(institution: current_institution).\n order(:name)\n end", "def index\n @project_profiles = ProjectProfile.all\n end" ]
[ "0.622121", "0.6171837", "0.613318", "0.61215836", "0.610758", "0.6089443", "0.6062317", "0.5965883", "0.59603125", "0.59340954", "0.59097725", "0.58970654", "0.5877867", "0.5876824", "0.5838917", "0.5827292", "0.58270675", "0.5821021", "0.57649034", "0.5748111", "0.5683791", "0.56539446", "0.56539446", "0.5637352", "0.56327504", "0.56300867", "0.5627018", "0.56139046", "0.5593972", "0.55897546", "0.55462974", "0.553995", "0.54824203", "0.5464241", "0.54325986", "0.54269886", "0.5426108", "0.5406748", "0.53967965", "0.5381679", "0.5378894", "0.53758746", "0.536964", "0.5368929", "0.53688425", "0.53561264", "0.5325822", "0.5325195", "0.531943", "0.5298061", "0.52951443", "0.5294908", "0.5290362", "0.5279424", "0.5275617", "0.5273647", "0.52590764", "0.5250606", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52321184", "0.52237386", "0.5215279", "0.52116513", "0.5209363", "0.5197582", "0.5197582", "0.51946235", "0.51914895", "0.5172924", "0.5170707", "0.5168221", "0.5157614", "0.515415", "0.5146263", "0.51459557", "0.5142806", "0.5141865", "0.5136492", "0.51348025", "0.5133034", "0.5129745", "0.5112771", "0.509192", "0.5085914", "0.5082521", "0.50818276" ]
0.56066656
28
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end" ]
[ "0.74398065", "0.74231076", "0.72141737", "0.7182919", "0.7162661", "0.713989", "0.67805517", "0.6753361", "0.6525983", "0.65237695", "0.64346457", "0.6292789", "0.6265245", "0.6153511", "0.60907227", "0.6079858", "0.60353255", "0.6019991", "0.5993825", "0.5971388", "0.5951406", "0.5939088", "0.59215426", "0.5885779", "0.58820355", "0.5866013", "0.5865107", "0.5856147", "0.5840359", "0.58164275", "0.57660294", "0.57412755", "0.5740913", "0.57408035", "0.5738951", "0.57275945", "0.5719054", "0.5707963", "0.56966096", "0.5695739", "0.5694527", "0.568879", "0.56802183", "0.5642229", "0.56365323", "0.561574", "0.56079674", "0.5606833", "0.55969834", "0.5591564", "0.5589847", "0.5586701", "0.5585094", "0.5576282", "0.55581254", "0.55576646", "0.5553215", "0.5545757", "0.5542619", "0.55323046", "0.5531375", "0.55183554", "0.5514258", "0.55070627", "0.55040896", "0.54946774", "0.5476864", "0.5474412", "0.5470673", "0.5463301", "0.5462803", "0.54600567", "0.5444794", "0.5439604", "0.543659", "0.54334223", "0.5429661", "0.5420206", "0.5411482", "0.5410591", "0.5403602", "0.5403602", "0.5400964", "0.54002094", "0.53989834", "0.5391938", "0.53908545", "0.5386149", "0.5368822", "0.53686315", "0.5366533", "0.5366533", "0.53641397", "0.53635544", "0.535364", "0.5348701", "0.5347901", "0.5346504", "0.5337149", "0.5336918" ]
0.68753177
6
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile" end # verify the required parameter 'l2_bridge_endpoint_profile' is set if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil? fail ArgumentError, "Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile" end # resource path local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end" ]
[ "0.7440173", "0.74238", "0.7183777", "0.7162514", "0.7139919", "0.68746734", "0.6780593", "0.67534924", "0.6525527", "0.65236706", "0.6434839", "0.6292552", "0.626511", "0.6154161", "0.60921836", "0.6080533", "0.6035727", "0.60206205", "0.59959066", "0.59720224", "0.5951914", "0.5939488", "0.59222174", "0.5884961", "0.58840495", "0.5865786", "0.5865397", "0.5857602", "0.5840359", "0.5815438", "0.5767913", "0.57437617", "0.57418406", "0.57417953", "0.57398397", "0.57296133", "0.57195044", "0.5709047", "0.5697537", "0.56966907", "0.5696481", "0.5689101", "0.5680501", "0.56426924", "0.5637506", "0.56171715", "0.5608636", "0.5607953", "0.5597087", "0.559252", "0.5591264", "0.55876607", "0.55850846", "0.5578132", "0.5558909", "0.55584973", "0.5554579", "0.5547443", "0.55443037", "0.5533041", "0.5532987", "0.55202997", "0.551566", "0.5509342", "0.5506234", "0.5495581", "0.54787", "0.54767644", "0.5472666", "0.5464097", "0.5463158", "0.5462026", "0.54461914", "0.54401666", "0.5436194", "0.5435556", "0.54306036", "0.5421809", "0.54123473", "0.54113185", "0.5405007", "0.5405007", "0.5402049", "0.54015094", "0.53993964", "0.53938705", "0.5392483", "0.53877854", "0.53702444", "0.5367119", "0.5367119", "0.5366182", "0.53653723", "0.53642815", "0.53544635", "0.53503484", "0.5347808", "0.53467786", "0.5338933", "0.5336845" ]
0.72147363
2
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.74412334", "0.7424626", "0.7215516", "0.7184345", "0.7162582", "0.68752944", "0.6781651", "0.675443", "0.65255797", "0.6524788", "0.6435752", "0.6294121", "0.6266573", "0.61533517", "0.6092006", "0.6080814", "0.6036426", "0.6019085", "0.5995237", "0.59725", "0.59515077", "0.5940472", "0.59208083", "0.5884632", "0.5882417", "0.5866951", "0.58664817", "0.58553976", "0.5841387", "0.581515", "0.5765931", "0.5742741", "0.5741904", "0.57401806", "0.574001", "0.57275254", "0.57204556", "0.5707345", "0.56976545", "0.56958544", "0.56947684", "0.56902504", "0.5680287", "0.5641379", "0.5637104", "0.56158096", "0.56087154", "0.5608543", "0.5598655", "0.559071", "0.5589894", "0.5588474", "0.5586771", "0.55762297", "0.55584395", "0.5557657", "0.5552587", "0.5545949", "0.5542954", "0.5532874", "0.55312556", "0.551784", "0.5514849", "0.5507142", "0.55038387", "0.5493892", "0.54776937", "0.5475227", "0.54703146", "0.54627556", "0.5462196", "0.5459615", "0.5445112", "0.5439366", "0.5436724", "0.5433004", "0.5428744", "0.5419726", "0.5412837", "0.54107916", "0.5403232", "0.5403232", "0.54013556", "0.54006004", "0.5399509", "0.53922045", "0.5390843", "0.53858066", "0.5368499", "0.5366836", "0.53665644", "0.53665644", "0.5364248", "0.53634113", "0.53541064", "0.53484565", "0.5347041", "0.53460735", "0.53375775", "0.5337448" ]
0.714014
5
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0" end # verify the required parameter 'l2_bridge_endpoint_profile' is set if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil? fail ArgumentError, "Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0" end # resource path local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7441519", "0.7424836", "0.7215665", "0.71624964", "0.7139739", "0.6875108", "0.6781137", "0.67538905", "0.65258217", "0.65243983", "0.64351976", "0.629415", "0.6266634", "0.615254", "0.60908175", "0.60808843", "0.6036305", "0.60189813", "0.5993805", "0.5972299", "0.595081", "0.5939249", "0.592011", "0.5884279", "0.5881234", "0.5867416", "0.5865258", "0.58550674", "0.5841651", "0.5814916", "0.5764511", "0.57419753", "0.57410306", "0.57390124", "0.57388824", "0.5727177", "0.5721029", "0.5707631", "0.5696996", "0.5695698", "0.56935227", "0.5690842", "0.5679706", "0.56408936", "0.5636206", "0.5614883", "0.5608914", "0.56066567", "0.5597951", "0.55897784", "0.55894226", "0.55888826", "0.55860025", "0.5575634", "0.5557447", "0.55566996", "0.55515826", "0.55454874", "0.5541902", "0.5530748", "0.55307156", "0.5516991", "0.5513736", "0.5506776", "0.550363", "0.54928875", "0.54765165", "0.54746294", "0.5469502", "0.5462197", "0.546182", "0.5458808", "0.5444364", "0.543848", "0.54375106", "0.5432497", "0.542788", "0.54194665", "0.5411742", "0.54080874", "0.5401888", "0.5401888", "0.5400266", "0.5399945", "0.5399636", "0.5391092", "0.5389816", "0.53855985", "0.5368127", "0.53671545", "0.536428", "0.536428", "0.53628296", "0.536263", "0.53532255", "0.53474253", "0.5347113", "0.534471", "0.53362644", "0.5335988" ]
0.71844035
3
Get L2 Bridge Endpoint Profile Read L2 bridge profile with ID profileid
def read_l2_bridge_profile(site_id, enforcement_point_id, profile_id, opts = {}) data, _status_code, _headers = read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "def profile; Profile.get(self.profile_id); end", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def _profile\n @link['profile']\n end", "def get_profile(profile_id)\n @type = Type::CIM_GET_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def get_profile\n\n # Auth\n token = auth\n\n # Get Client info based on fields provided\n client = LinkedIn::Client.new(API_KEY, API_SECRET, token)\n client.profile(:fields => @profile_fields)\n end", "def profile\n @profile ||= Profile.find_for_uid_and_network(self.uid, self.provider)\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'get', 'KalturaOSSAdapterProfile', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end", "def profile\n @property[:profile]\n end", "def get_profile(connector, id, options={})\n brief = options.delete :brief || false\n json = connector.prepare_and_invoke_api_call(\n \"profiles/v1/providers/#{id}\" + (brief ? \"/brief\" : \"\"), :method=>:get)\n return self.new(json['profile'])\n end", "def get_app_profile instance_id, app_profile_id\n instances.get_app_profile name: app_profile_path(instance_id, app_profile_id)\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def profile(profile_name:)\n claim_url = \"#{@@profile_service_url}/profile/#{profile_name}/next\"\n response = Faraday.get claim_url\n profile = JSON.parse(response.body)\n raise \"No profile available for #{profile_name}\" unless profile\n profile\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def profile\n return nil unless user_loa3\n\n mvi_response&.profile\n end", "def get_app_profile instance_id, app_profile_id\n execute do\n instances.get_app_profile(\n app_profile_path(instance_id, app_profile_id)\n )\n end\n end", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def findProfile(profile_id)\n # assuming there is only one profile with this profile_id\n @profile = Profile.where(identity: profile_id).first\n return @profile\n end", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.find(params[:id])\n\tend", "def get_profile\n self.class.get '/members/private', @options\n end", "def find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations\", :nameRepository => 'gicat'\n req.headers = @authorization_headers\n end\n\n profile_id = parse_profile_element(profile_name, response.body)\n\n return profile_id\n end", "def get_sap_profile(sap_profile_id)\n get(\"cloud-instances/#{guid}/sap/#{sap_profile_id}\")\n end", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def profile_id\n Settings.cybersource.profile_id\n end", "def load_profile(params)\n db = connect()\n profile = db.execute('SELECT * FROM users WHERE Id=?', params[\"id\"])\n return profile.first\n end", "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end", "def get_node_profile\n rpc_get_fact_direct('node_profile')\n end", "def get_active_profile_id\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/giconf/configuration\"\n req.headers = @standard_headers\n end\n\n profile_id = response.body\n return profile_id\n end", "def profile\n if @profile\n return @profile\n end\n\n @profile ||= begin\n h = profile_xml_to_hash(@catalog.search @route => @name )\n @new = false\n h\n rescue RestClient::ResourceNotFound\n # The resource is new\n @new = true\n {}\n end.freeze\n end", "def personal_profile\n RubyRedtail::Query.run(\"contacts/#{@id}/personalprofile\", @api_hash, \"GET\")\n end", "def profile\n unless @profile\n if associated_profile\n @profile = Profile.new(associated_profile)\n else\n options = {:fields => 'user_id', :includes => 'Profile'}\n options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)\n tmp = User.find(username, options)\n @profile = Profile.new(tmp.associated_profile)\n end\n end\n @profile\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend", "def profile(profile_id, fields: nil)\n check_not_empty profile_id, 'profile_id'\n params = build_fields_params fields\n res = @connection.get profile_path(profile_id), params\n Profile.new res.body, self\n end", "def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end", "def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end", "def extract_profile(args)\n return args.shift if args.first.is_a?(Management::Profile)\n return args.pop if args.last.is_a?(Management::Profile)\n profile\n end", "def sell_shipping_profile_find (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.get url, req \r\n end \r\n end", "def read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def user_profile(id)\n users(request(\"users/profile/#{id}.xml\", :auth => true))\n end", "def profile_url\n @data[:profile_url]\n end", "def read_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find(participant_id:, profile_date:)\n response = request(:read_rating_profile, \"veteranId\": participant_id, \"profileDate\": profile_date)\n\n # Purposely avoiding much data processing here to do that in the application layer\n response.body[:read_rating_profile_response][:rba_profile]\n end", "def get_network_wireless_rf_profile(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'rf_profile_id' => options['rf_profile_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/wireless/rfProfiles/{rfProfileId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'rfProfileId' => options['rf_profile_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authentication_key)\n end", "def current_profile\n @profile ||= JSON.parse($redis.get(\"profile\"))\n end", "def profile(name)\n @profiles.find { |p| p.name == name }\n end", "def get_profile(id)\n \t\tfb_profile_url = FB_PROFILE + id + FB_PROFILE_FIELDS\n \t\tprofile_details = HTTParty.get(fb_profile_url)\n \t\t@first_name = profile_details[\"first_name\"]\n \t\t@last_name = profile_details[\"last_name\"]\n \t\t@profile_pic = profile_details[\"profile_pic\"]\n \t\t@locale = profile_details[\"locale\"]\n \t\t@gender = profile_details[\"gender\"]\n \tend", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authenticated_key)\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def profile_details\n # Since 15th September 2016 certificates and devices are hidden behind another request\n # see https://github.com/fastlane/fastlane/issues/6137 for more information\n @profile_details ||= client.provisioning_profile_details(provisioning_profile_id: self.id, mac: mac?)\n end", "def get_default_profile \n get(\"/profiles.json/default\")\nend", "def social_profile(provider)\n social_profiles.select{ |sp| sp.provider == provider.to_s }.first\n end", "def profile_name\n return self.profile.name\n end", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def get_active_profile_distributor_id(profile_id)\n active_profile_request = \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\"\n response = Faraday.get do |req|\n req.url active_profile_request\n req.headers = @authorization_headers\n end\n distributor_id = Nokogiri.XML(response.body).css(\"component id\").text\n return distributor_id\n end", "def mvp_profile\n owned_profiles.last\n end", "def xml_query_profile(xml) \n if current_user \n profile_name = (xml.root.get_elements('AccessProfile').first || empty).text \n profile_name = 'public' unless profile_name \n @profile = current_user.profiles.find_by_title(profile_name) \n return render(:text => \"<Response>bad profile</Response>\") unless @profile \n \n properties = @profile.properties.map{|p| p.property_type.title }.join(',') \n return render(:text => \"<Response>#{properties}</Response>\") \n end \n render(:text => \"<Response>Internal Error</Response>\") \n end", "def getProfile\n account = current_user.account\n if account.nil?\n render status: 400, json: {error: \"Invalid User\"}\n else\n if current_user.registered && (account.referral_code.nil? || account.referral_code.blank?)\n account.generate_referral_code\n end\n render status: 200, json: {username: current_user.username,\n email: current_user.email,\n firstName: current_user.first_name,\n lastName: current_user.last_name,\n company: current_user.company,\n balance: account.balance,\n registered: current_user.registered,\n referralCode: account.referral_code}\n end\n end", "def profile_url\n @json['profile']['url'] rescue nil\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('conversionprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def profile\n @profile ||= begin\n profile_xml = repository.datastream(:pid => pid, :dsid => dsid)\n profile_xml.gsub! '<datastreamProfile', '<datastreamProfile xmlns=\"http://www.fedora.info/definitions/1/0/management/\"' unless profile_xml =~ /xmlns=/\n doc = Nokogiri::XML(profile_xml)\n h = doc.xpath('/management:datastreamProfile/*', {'management' => \"http://www.fedora.info/definitions/1/0/management/\"} ).inject({}) do |sum, node|\n sum[node.name] ||= []\n sum[node.name] << node.text\n sum\n end\n h.select { |key, value| value.length == 1 }.each do |key, value|\n h[key] = value.first\n end\n\n h\n rescue\n {}\n end\n end", "def profile\n\n end", "def profile\n if Configuration.host_based_profiles\n request_hostname\n else\n CurrentUser.user_settings[:profile].to_sym if CurrentUser.user_settings[:profile]\n end\n end", "def get_bot_profile\n bot_profile = command.event.bot.profile.on(command.event.server)\n end", "def find_profile\n @user = User.find_by_username(params[:id])\n @profile = @user.profile\n end", "def default_profile\n profiles.find_by_id(default_profile_id)\n end", "def profile\n @profile ||= repository_profile\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_profile(session, user_id)\n $client.authorization.update_token!(session[:token].to_hash)\n plus = $client.discovered_api('plus')\n\n Rails.logger.debug \"TokenPair: #{$client.authorization.to_yaml}\"\n result = $client.execute(\n :api_method => plus.people.get,\n :parameters => {'userId' => user_id})\n\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n Rails.logger.debug \"GoogleClient: NM #{result.data['displayName']}\"\n Rails.logger.debug \"GoogleClient: IM #{result.data['image']['url']}\"\n Rails.logger.debug \"GoogleClient: PR #{result.data['url']}\"\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n\n @profile = Hash.new\n @profile[:name] = result.data['displayName']\n @profile[:profile_url] = result.data['url']\n\n # Avatar sizes\n @profile[:img_url] = result.data['image']['url']\n @profile[:img_url].gsub!(/sz=\\d+$/, \"\")\n\n @profile[:img_thumb_url] = @profile[:img_url] + 'sz=100'\n @profile[:img_tiny_url] = @profile[:img_url] + 'sz=32'\n @profile[:img_badge_url] = @profile[:img_url] + 'sz=15'\n\n return @profile\n end", "def profile\n p7sign, device_attributes = OtaEnroll::Cert.decrypt_request(request.body.read)\n icon_url = params.delete(:icon_url)\n icon_label = params.delete(:icon_label)\n callback_url, extra_data = (params.delete(:callback_url)||'').split(/\\?/)\n \n # parse callback_url extra data\n extra_data = extra_data.split(/&/).inject({}){|k, v| c=v.split(/=/);k[c[0]] = c[1];k} rescue {}\n\n data = device_attributes.inject({}){|a,(k,v)| a[k.downcase.to_sym] = v; a}.merge(params.reject{|k,v| ['controller','action'].include?(k.to_s)})\n data.merge!(extra_data)\n\n # do pingback with values and callback_secret\n query = calculate_secret(data, OtaEnroll.settings.callback_secret)\n logger.info \"callback: #{query}\" if debug?\n Net::HTTP.get(URI.parse(\"#{callback_url}?#{query}\"))\n\n certs = OtaEnroll::Tools.new\n # create payload\n\n logger.info \"profile signers \\\"#{p7sign.signers[0].issuer.to_s}\\\" == \\\"#{certs.root_cert.subject.to_s}\\\"\" if debug?\n \n if (p7sign.signers[0].issuer.to_s == certs.root_cert.subject.to_s)\n payload = OtaEnroll::Enroll.client_cert_configuration_payload(request, icon_url, icon_label)\n encrypted_profile = OpenSSL::PKCS7.encrypt(p7sign.certificates,\n payload, OpenSSL::Cipher::Cipher::new(\"des-ede3-cbc\"), OpenSSL::PKCS7::BINARY)\n configuration = OtaEnroll::Enroll.configuration_payload(request, encrypted_profile.to_der)\n else\n configuration = OtaEnroll::Enroll.encryption_cert_payload(request, \"\", scep_url)\n end\n\n logger.info \"profile configuration: #{configuration}\" if debug?\n \n sign_certs = []\n sign_certs = [certs.sign_interm_cert] if certs.sign_interm_cert.present?\n \n signed_profile = OpenSSL::PKCS7.sign(certs.ssl_cert, certs.ssl_key, configuration, sign_certs, OpenSSL::PKCS7::BINARY)\n send_data signed_profile.to_der, content_type: \"application/x-apple-aspen-config\"\n end", "def get_payment_profile(payment_profile_id, profile_id)\n @type = Type::CIM_GET_PAYMENT\n handle_payment_profile_id(payment_profile_id)\n handle_profile_id(profile_id)\n make_request\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def read_ipfixl2_profile(ipfix_l2_profile_id, opts = {})\n data, _status_code, _headers = read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts)\n data\n end", "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_user_profile(uid, user_id = uid)\n if user_id == \"system\"\n profile = Profile.new\n profile[\"name\"] = \"World\"\n return profile\n end\n\n cl = client(\"Users\", uid)\n response = cl.call(:get_user_profile, \"message\" => { \"uid\" => user_id })\n raise Error unless response.success?\n\n return response.to_hash[:get_user_profile_response][:return][:attributes].inject(Profile.new) do |memo, attr|\n memo[attr[:name]] = attr[:value]\n memo\n end\n rescue Savon::SOAPFault => e\n process_error e\n end", "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end", "def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instance_profile_id\n data.instance_profile_id\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def get_profile_url_linkedin\n profile_url = self[:info][:urls][:public_profile] if self[:info] and self[:info][:urls]\n profile_url.gsub!(/^http:/, 'https:') if profile_url # protect cookies\n profile_url\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.7228726", "0.72203064", "0.6971988", "0.69307995", "0.6919285", "0.68600434", "0.681343", "0.6758999", "0.67305", "0.66180146", "0.66109884", "0.66056293", "0.65936095", "0.6586344", "0.65701485", "0.6568907", "0.65557253", "0.65474814", "0.6527027", "0.6517917", "0.647713", "0.6468753", "0.6460488", "0.6434658", "0.63986284", "0.63889617", "0.6335652", "0.63330483", "0.6327716", "0.6327716", "0.6256404", "0.6242537", "0.6215136", "0.6185144", "0.6176553", "0.6165111", "0.61591667", "0.61527133", "0.6120841", "0.6093949", "0.60873747", "0.6072695", "0.6050724", "0.6044327", "0.6044023", "0.6037969", "0.5968485", "0.5968002", "0.5918022", "0.5908321", "0.5901775", "0.58908415", "0.5881121", "0.586789", "0.58640033", "0.58497643", "0.58466977", "0.5842589", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5840284", "0.58369625", "0.58359325", "0.5832797", "0.5831557", "0.5808309", "0.5797399", "0.57943046", "0.5767291", "0.57672065", "0.57597", "0.5752223", "0.57474947", "0.5741912", "0.57412416", "0.57366043", "0.572698", "0.57262653", "0.57252884", "0.5714246", "0.57120353", "0.57096076", "0.56992084", "0.56888145", "0.56888145", "0.5664899", "0.5659892", "0.56509256", "0.5650065", "0.56453305", "0.56347376", "0.56276417", "0.56252223", "0.5618585", "0.56166744", "0.561396" ]
0.6773237
7
Get L2 Bridge Endpoint Profile Read L2 bridge profile with ID profileid
def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile" end # resource path local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'L2BridgeEndpointProfile') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "def profile; Profile.get(self.profile_id); end", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def _profile\n @link['profile']\n end", "def get_profile(profile_id)\n @type = Type::CIM_GET_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def read_l2_bridge_profile(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def get_profile\n\n # Auth\n token = auth\n\n # Get Client info based on fields provided\n client = LinkedIn::Client.new(API_KEY, API_SECRET, token)\n client.profile(:fields => @profile_fields)\n end", "def profile\n @profile ||= Profile.find_for_uid_and_network(self.uid, self.provider)\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'get', 'KalturaOSSAdapterProfile', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end", "def profile\n @property[:profile]\n end", "def get_profile(connector, id, options={})\n brief = options.delete :brief || false\n json = connector.prepare_and_invoke_api_call(\n \"profiles/v1/providers/#{id}\" + (brief ? \"/brief\" : \"\"), :method=>:get)\n return self.new(json['profile'])\n end", "def get_app_profile instance_id, app_profile_id\n instances.get_app_profile name: app_profile_path(instance_id, app_profile_id)\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def profile(profile_name:)\n claim_url = \"#{@@profile_service_url}/profile/#{profile_name}/next\"\n response = Faraday.get claim_url\n profile = JSON.parse(response.body)\n raise \"No profile available for #{profile_name}\" unless profile\n profile\n end", "def profile\n return nil unless user_loa3\n\n mvi_response&.profile\n end", "def get_app_profile instance_id, app_profile_id\n execute do\n instances.get_app_profile(\n app_profile_path(instance_id, app_profile_id)\n )\n end\n end", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def findProfile(profile_id)\n # assuming there is only one profile with this profile_id\n @profile = Profile.where(identity: profile_id).first\n return @profile\n end", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.find(params[:id])\n\tend", "def get_profile\n self.class.get '/members/private', @options\n end", "def find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations\", :nameRepository => 'gicat'\n req.headers = @authorization_headers\n end\n\n profile_id = parse_profile_element(profile_name, response.body)\n\n return profile_id\n end", "def get_sap_profile(sap_profile_id)\n get(\"cloud-instances/#{guid}/sap/#{sap_profile_id}\")\n end", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def profile_id\n Settings.cybersource.profile_id\n end", "def load_profile(params)\n db = connect()\n profile = db.execute('SELECT * FROM users WHERE Id=?', params[\"id\"])\n return profile.first\n end", "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end", "def get_node_profile\n rpc_get_fact_direct('node_profile')\n end", "def get_active_profile_id\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/giconf/configuration\"\n req.headers = @standard_headers\n end\n\n profile_id = response.body\n return profile_id\n end", "def profile\n if @profile\n return @profile\n end\n\n @profile ||= begin\n h = profile_xml_to_hash(@catalog.search @route => @name )\n @new = false\n h\n rescue RestClient::ResourceNotFound\n # The resource is new\n @new = true\n {}\n end.freeze\n end", "def personal_profile\n RubyRedtail::Query.run(\"contacts/#{@id}/personalprofile\", @api_hash, \"GET\")\n end", "def profile\n unless @profile\n if associated_profile\n @profile = Profile.new(associated_profile)\n else\n options = {:fields => 'user_id', :includes => 'Profile'}\n options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)\n tmp = User.find(username, options)\n @profile = Profile.new(tmp.associated_profile)\n end\n end\n @profile\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend", "def profile(profile_id, fields: nil)\n check_not_empty profile_id, 'profile_id'\n params = build_fields_params fields\n res = @connection.get profile_path(profile_id), params\n Profile.new res.body, self\n end", "def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end", "def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end", "def extract_profile(args)\n return args.shift if args.first.is_a?(Management::Profile)\n return args.pop if args.last.is_a?(Management::Profile)\n profile\n end", "def sell_shipping_profile_find (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.get url, req \r\n end \r\n end", "def read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def user_profile(id)\n users(request(\"users/profile/#{id}.xml\", :auth => true))\n end", "def profile_url\n @data[:profile_url]\n end", "def read_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find(participant_id:, profile_date:)\n response = request(:read_rating_profile, \"veteranId\": participant_id, \"profileDate\": profile_date)\n\n # Purposely avoiding much data processing here to do that in the application layer\n response.body[:read_rating_profile_response][:rba_profile]\n end", "def get_network_wireless_rf_profile(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'rf_profile_id' => options['rf_profile_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/wireless/rfProfiles/{rfProfileId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'rfProfileId' => options['rf_profile_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authentication_key)\n end", "def current_profile\n @profile ||= JSON.parse($redis.get(\"profile\"))\n end", "def profile(name)\n @profiles.find { |p| p.name == name }\n end", "def get_profile(id)\n \t\tfb_profile_url = FB_PROFILE + id + FB_PROFILE_FIELDS\n \t\tprofile_details = HTTParty.get(fb_profile_url)\n \t\t@first_name = profile_details[\"first_name\"]\n \t\t@last_name = profile_details[\"last_name\"]\n \t\t@profile_pic = profile_details[\"profile_pic\"]\n \t\t@locale = profile_details[\"locale\"]\n \t\t@gender = profile_details[\"gender\"]\n \tend", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authenticated_key)\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def profile_details\n # Since 15th September 2016 certificates and devices are hidden behind another request\n # see https://github.com/fastlane/fastlane/issues/6137 for more information\n @profile_details ||= client.provisioning_profile_details(provisioning_profile_id: self.id, mac: mac?)\n end", "def get_default_profile \n get(\"/profiles.json/default\")\nend", "def social_profile(provider)\n social_profiles.select{ |sp| sp.provider == provider.to_s }.first\n end", "def profile_name\n return self.profile.name\n end", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def get_active_profile_distributor_id(profile_id)\n active_profile_request = \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\"\n response = Faraday.get do |req|\n req.url active_profile_request\n req.headers = @authorization_headers\n end\n distributor_id = Nokogiri.XML(response.body).css(\"component id\").text\n return distributor_id\n end", "def mvp_profile\n owned_profiles.last\n end", "def xml_query_profile(xml) \n if current_user \n profile_name = (xml.root.get_elements('AccessProfile').first || empty).text \n profile_name = 'public' unless profile_name \n @profile = current_user.profiles.find_by_title(profile_name) \n return render(:text => \"<Response>bad profile</Response>\") unless @profile \n \n properties = @profile.properties.map{|p| p.property_type.title }.join(',') \n return render(:text => \"<Response>#{properties}</Response>\") \n end \n render(:text => \"<Response>Internal Error</Response>\") \n end", "def getProfile\n account = current_user.account\n if account.nil?\n render status: 400, json: {error: \"Invalid User\"}\n else\n if current_user.registered && (account.referral_code.nil? || account.referral_code.blank?)\n account.generate_referral_code\n end\n render status: 200, json: {username: current_user.username,\n email: current_user.email,\n firstName: current_user.first_name,\n lastName: current_user.last_name,\n company: current_user.company,\n balance: account.balance,\n registered: current_user.registered,\n referralCode: account.referral_code}\n end\n end", "def profile_url\n @json['profile']['url'] rescue nil\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('conversionprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def profile\n @profile ||= begin\n profile_xml = repository.datastream(:pid => pid, :dsid => dsid)\n profile_xml.gsub! '<datastreamProfile', '<datastreamProfile xmlns=\"http://www.fedora.info/definitions/1/0/management/\"' unless profile_xml =~ /xmlns=/\n doc = Nokogiri::XML(profile_xml)\n h = doc.xpath('/management:datastreamProfile/*', {'management' => \"http://www.fedora.info/definitions/1/0/management/\"} ).inject({}) do |sum, node|\n sum[node.name] ||= []\n sum[node.name] << node.text\n sum\n end\n h.select { |key, value| value.length == 1 }.each do |key, value|\n h[key] = value.first\n end\n\n h\n rescue\n {}\n end\n end", "def profile\n\n end", "def profile\n if Configuration.host_based_profiles\n request_hostname\n else\n CurrentUser.user_settings[:profile].to_sym if CurrentUser.user_settings[:profile]\n end\n end", "def get_bot_profile\n bot_profile = command.event.bot.profile.on(command.event.server)\n end", "def find_profile\n @user = User.find_by_username(params[:id])\n @profile = @user.profile\n end", "def default_profile\n profiles.find_by_id(default_profile_id)\n end", "def profile\n @profile ||= repository_profile\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_profile(session, user_id)\n $client.authorization.update_token!(session[:token].to_hash)\n plus = $client.discovered_api('plus')\n\n Rails.logger.debug \"TokenPair: #{$client.authorization.to_yaml}\"\n result = $client.execute(\n :api_method => plus.people.get,\n :parameters => {'userId' => user_id})\n\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n Rails.logger.debug \"GoogleClient: NM #{result.data['displayName']}\"\n Rails.logger.debug \"GoogleClient: IM #{result.data['image']['url']}\"\n Rails.logger.debug \"GoogleClient: PR #{result.data['url']}\"\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n\n @profile = Hash.new\n @profile[:name] = result.data['displayName']\n @profile[:profile_url] = result.data['url']\n\n # Avatar sizes\n @profile[:img_url] = result.data['image']['url']\n @profile[:img_url].gsub!(/sz=\\d+$/, \"\")\n\n @profile[:img_thumb_url] = @profile[:img_url] + 'sz=100'\n @profile[:img_tiny_url] = @profile[:img_url] + 'sz=32'\n @profile[:img_badge_url] = @profile[:img_url] + 'sz=15'\n\n return @profile\n end", "def profile\n p7sign, device_attributes = OtaEnroll::Cert.decrypt_request(request.body.read)\n icon_url = params.delete(:icon_url)\n icon_label = params.delete(:icon_label)\n callback_url, extra_data = (params.delete(:callback_url)||'').split(/\\?/)\n \n # parse callback_url extra data\n extra_data = extra_data.split(/&/).inject({}){|k, v| c=v.split(/=/);k[c[0]] = c[1];k} rescue {}\n\n data = device_attributes.inject({}){|a,(k,v)| a[k.downcase.to_sym] = v; a}.merge(params.reject{|k,v| ['controller','action'].include?(k.to_s)})\n data.merge!(extra_data)\n\n # do pingback with values and callback_secret\n query = calculate_secret(data, OtaEnroll.settings.callback_secret)\n logger.info \"callback: #{query}\" if debug?\n Net::HTTP.get(URI.parse(\"#{callback_url}?#{query}\"))\n\n certs = OtaEnroll::Tools.new\n # create payload\n\n logger.info \"profile signers \\\"#{p7sign.signers[0].issuer.to_s}\\\" == \\\"#{certs.root_cert.subject.to_s}\\\"\" if debug?\n \n if (p7sign.signers[0].issuer.to_s == certs.root_cert.subject.to_s)\n payload = OtaEnroll::Enroll.client_cert_configuration_payload(request, icon_url, icon_label)\n encrypted_profile = OpenSSL::PKCS7.encrypt(p7sign.certificates,\n payload, OpenSSL::Cipher::Cipher::new(\"des-ede3-cbc\"), OpenSSL::PKCS7::BINARY)\n configuration = OtaEnroll::Enroll.configuration_payload(request, encrypted_profile.to_der)\n else\n configuration = OtaEnroll::Enroll.encryption_cert_payload(request, \"\", scep_url)\n end\n\n logger.info \"profile configuration: #{configuration}\" if debug?\n \n sign_certs = []\n sign_certs = [certs.sign_interm_cert] if certs.sign_interm_cert.present?\n \n signed_profile = OpenSSL::PKCS7.sign(certs.ssl_cert, certs.ssl_key, configuration, sign_certs, OpenSSL::PKCS7::BINARY)\n send_data signed_profile.to_der, content_type: \"application/x-apple-aspen-config\"\n end", "def get_payment_profile(payment_profile_id, profile_id)\n @type = Type::CIM_GET_PAYMENT\n handle_payment_profile_id(payment_profile_id)\n handle_profile_id(profile_id)\n make_request\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def read_ipfixl2_profile(ipfix_l2_profile_id, opts = {})\n data, _status_code, _headers = read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts)\n data\n end", "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_user_profile(uid, user_id = uid)\n if user_id == \"system\"\n profile = Profile.new\n profile[\"name\"] = \"World\"\n return profile\n end\n\n cl = client(\"Users\", uid)\n response = cl.call(:get_user_profile, \"message\" => { \"uid\" => user_id })\n raise Error unless response.success?\n\n return response.to_hash[:get_user_profile_response][:return][:attributes].inject(Profile.new) do |memo, attr|\n memo[attr[:name]] = attr[:value]\n memo\n end\n rescue Savon::SOAPFault => e\n process_error e\n end", "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end", "def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instance_profile_id\n data.instance_profile_id\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def get_profile_url_linkedin\n profile_url = self[:info][:urls][:public_profile] if self[:info] and self[:info][:urls]\n profile_url.gsub!(/^http:/, 'https:') if profile_url # protect cookies\n profile_url\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.7228726", "0.72203064", "0.6971988", "0.69307995", "0.6919285", "0.68600434", "0.681343", "0.6773237", "0.6758999", "0.67305", "0.66180146", "0.66109884", "0.66056293", "0.65936095", "0.6586344", "0.65701485", "0.6568907", "0.65557253", "0.65474814", "0.6527027", "0.647713", "0.6468753", "0.6460488", "0.6434658", "0.63986284", "0.63889617", "0.6335652", "0.63330483", "0.6327716", "0.6327716", "0.6256404", "0.6242537", "0.6215136", "0.6185144", "0.6176553", "0.6165111", "0.61591667", "0.61527133", "0.6120841", "0.6093949", "0.60873747", "0.6072695", "0.6050724", "0.6044327", "0.6044023", "0.6037969", "0.5968485", "0.5968002", "0.5918022", "0.5908321", "0.5901775", "0.58908415", "0.5881121", "0.586789", "0.58640033", "0.58497643", "0.58466977", "0.5842589", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5840284", "0.58369625", "0.58359325", "0.5832797", "0.5831557", "0.5808309", "0.5797399", "0.57943046", "0.5767291", "0.57672065", "0.57597", "0.5752223", "0.57474947", "0.5741912", "0.57412416", "0.57366043", "0.572698", "0.57262653", "0.57252884", "0.5714246", "0.57120353", "0.57096076", "0.56992084", "0.56888145", "0.56888145", "0.5664899", "0.5659892", "0.56509256", "0.5650065", "0.56453305", "0.56347376", "0.56276417", "0.56252223", "0.5618585", "0.56166744", "0.561396" ]
0.6517917
20
Get L2 Bridge Endpoint Profile Read L2 bridge profile with ID profileid
def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {}) data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "def profile; Profile.get(self.profile_id); end", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def _profile\n @link['profile']\n end", "def get_profile(profile_id)\n @type = Type::CIM_GET_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def read_l2_bridge_profile(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def get_profile\n\n # Auth\n token = auth\n\n # Get Client info based on fields provided\n client = LinkedIn::Client.new(API_KEY, API_SECRET, token)\n client.profile(:fields => @profile_fields)\n end", "def profile\n @profile ||= Profile.find_for_uid_and_network(self.uid, self.provider)\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'get', 'KalturaOSSAdapterProfile', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end", "def profile\n @property[:profile]\n end", "def get_profile(connector, id, options={})\n brief = options.delete :brief || false\n json = connector.prepare_and_invoke_api_call(\n \"profiles/v1/providers/#{id}\" + (brief ? \"/brief\" : \"\"), :method=>:get)\n return self.new(json['profile'])\n end", "def get_app_profile instance_id, app_profile_id\n instances.get_app_profile name: app_profile_path(instance_id, app_profile_id)\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def profile(profile_name:)\n claim_url = \"#{@@profile_service_url}/profile/#{profile_name}/next\"\n response = Faraday.get claim_url\n profile = JSON.parse(response.body)\n raise \"No profile available for #{profile_name}\" unless profile\n profile\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def profile\n return nil unless user_loa3\n\n mvi_response&.profile\n end", "def get_app_profile instance_id, app_profile_id\n execute do\n instances.get_app_profile(\n app_profile_path(instance_id, app_profile_id)\n )\n end\n end", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def findProfile(profile_id)\n # assuming there is only one profile with this profile_id\n @profile = Profile.where(identity: profile_id).first\n return @profile\n end", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.find(params[:id])\n\tend", "def get_profile\n self.class.get '/members/private', @options\n end", "def find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations\", :nameRepository => 'gicat'\n req.headers = @authorization_headers\n end\n\n profile_id = parse_profile_element(profile_name, response.body)\n\n return profile_id\n end", "def get_sap_profile(sap_profile_id)\n get(\"cloud-instances/#{guid}/sap/#{sap_profile_id}\")\n end", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def profile_id\n Settings.cybersource.profile_id\n end", "def load_profile(params)\n db = connect()\n profile = db.execute('SELECT * FROM users WHERE Id=?', params[\"id\"])\n return profile.first\n end", "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end", "def get_node_profile\n rpc_get_fact_direct('node_profile')\n end", "def get_active_profile_id\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/giconf/configuration\"\n req.headers = @standard_headers\n end\n\n profile_id = response.body\n return profile_id\n end", "def profile\n if @profile\n return @profile\n end\n\n @profile ||= begin\n h = profile_xml_to_hash(@catalog.search @route => @name )\n @new = false\n h\n rescue RestClient::ResourceNotFound\n # The resource is new\n @new = true\n {}\n end.freeze\n end", "def personal_profile\n RubyRedtail::Query.run(\"contacts/#{@id}/personalprofile\", @api_hash, \"GET\")\n end", "def profile\n unless @profile\n if associated_profile\n @profile = Profile.new(associated_profile)\n else\n options = {:fields => 'user_id', :includes => 'Profile'}\n options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)\n tmp = User.find(username, options)\n @profile = Profile.new(tmp.associated_profile)\n end\n end\n @profile\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend", "def profile(profile_id, fields: nil)\n check_not_empty profile_id, 'profile_id'\n params = build_fields_params fields\n res = @connection.get profile_path(profile_id), params\n Profile.new res.body, self\n end", "def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end", "def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end", "def extract_profile(args)\n return args.shift if args.first.is_a?(Management::Profile)\n return args.pop if args.last.is_a?(Management::Profile)\n profile\n end", "def sell_shipping_profile_find (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.get url, req \r\n end \r\n end", "def read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def user_profile(id)\n users(request(\"users/profile/#{id}.xml\", :auth => true))\n end", "def profile_url\n @data[:profile_url]\n end", "def read_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find(participant_id:, profile_date:)\n response = request(:read_rating_profile, \"veteranId\": participant_id, \"profileDate\": profile_date)\n\n # Purposely avoiding much data processing here to do that in the application layer\n response.body[:read_rating_profile_response][:rba_profile]\n end", "def get_network_wireless_rf_profile(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'rf_profile_id' => options['rf_profile_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/wireless/rfProfiles/{rfProfileId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'rfProfileId' => options['rf_profile_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authentication_key)\n end", "def current_profile\n @profile ||= JSON.parse($redis.get(\"profile\"))\n end", "def profile(name)\n @profiles.find { |p| p.name == name }\n end", "def get_profile(id)\n \t\tfb_profile_url = FB_PROFILE + id + FB_PROFILE_FIELDS\n \t\tprofile_details = HTTParty.get(fb_profile_url)\n \t\t@first_name = profile_details[\"first_name\"]\n \t\t@last_name = profile_details[\"last_name\"]\n \t\t@profile_pic = profile_details[\"profile_pic\"]\n \t\t@locale = profile_details[\"locale\"]\n \t\t@gender = profile_details[\"gender\"]\n \tend", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authenticated_key)\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def profile_details\n # Since 15th September 2016 certificates and devices are hidden behind another request\n # see https://github.com/fastlane/fastlane/issues/6137 for more information\n @profile_details ||= client.provisioning_profile_details(provisioning_profile_id: self.id, mac: mac?)\n end", "def get_default_profile \n get(\"/profiles.json/default\")\nend", "def social_profile(provider)\n social_profiles.select{ |sp| sp.provider == provider.to_s }.first\n end", "def profile_name\n return self.profile.name\n end", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def get_active_profile_distributor_id(profile_id)\n active_profile_request = \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\"\n response = Faraday.get do |req|\n req.url active_profile_request\n req.headers = @authorization_headers\n end\n distributor_id = Nokogiri.XML(response.body).css(\"component id\").text\n return distributor_id\n end", "def mvp_profile\n owned_profiles.last\n end", "def xml_query_profile(xml) \n if current_user \n profile_name = (xml.root.get_elements('AccessProfile').first || empty).text \n profile_name = 'public' unless profile_name \n @profile = current_user.profiles.find_by_title(profile_name) \n return render(:text => \"<Response>bad profile</Response>\") unless @profile \n \n properties = @profile.properties.map{|p| p.property_type.title }.join(',') \n return render(:text => \"<Response>#{properties}</Response>\") \n end \n render(:text => \"<Response>Internal Error</Response>\") \n end", "def getProfile\n account = current_user.account\n if account.nil?\n render status: 400, json: {error: \"Invalid User\"}\n else\n if current_user.registered && (account.referral_code.nil? || account.referral_code.blank?)\n account.generate_referral_code\n end\n render status: 200, json: {username: current_user.username,\n email: current_user.email,\n firstName: current_user.first_name,\n lastName: current_user.last_name,\n company: current_user.company,\n balance: account.balance,\n registered: current_user.registered,\n referralCode: account.referral_code}\n end\n end", "def profile_url\n @json['profile']['url'] rescue nil\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('conversionprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def profile\n @profile ||= begin\n profile_xml = repository.datastream(:pid => pid, :dsid => dsid)\n profile_xml.gsub! '<datastreamProfile', '<datastreamProfile xmlns=\"http://www.fedora.info/definitions/1/0/management/\"' unless profile_xml =~ /xmlns=/\n doc = Nokogiri::XML(profile_xml)\n h = doc.xpath('/management:datastreamProfile/*', {'management' => \"http://www.fedora.info/definitions/1/0/management/\"} ).inject({}) do |sum, node|\n sum[node.name] ||= []\n sum[node.name] << node.text\n sum\n end\n h.select { |key, value| value.length == 1 }.each do |key, value|\n h[key] = value.first\n end\n\n h\n rescue\n {}\n end\n end", "def profile\n\n end", "def profile\n if Configuration.host_based_profiles\n request_hostname\n else\n CurrentUser.user_settings[:profile].to_sym if CurrentUser.user_settings[:profile]\n end\n end", "def get_bot_profile\n bot_profile = command.event.bot.profile.on(command.event.server)\n end", "def find_profile\n @user = User.find_by_username(params[:id])\n @profile = @user.profile\n end", "def default_profile\n profiles.find_by_id(default_profile_id)\n end", "def profile\n @profile ||= repository_profile\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_profile(session, user_id)\n $client.authorization.update_token!(session[:token].to_hash)\n plus = $client.discovered_api('plus')\n\n Rails.logger.debug \"TokenPair: #{$client.authorization.to_yaml}\"\n result = $client.execute(\n :api_method => plus.people.get,\n :parameters => {'userId' => user_id})\n\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n Rails.logger.debug \"GoogleClient: NM #{result.data['displayName']}\"\n Rails.logger.debug \"GoogleClient: IM #{result.data['image']['url']}\"\n Rails.logger.debug \"GoogleClient: PR #{result.data['url']}\"\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n\n @profile = Hash.new\n @profile[:name] = result.data['displayName']\n @profile[:profile_url] = result.data['url']\n\n # Avatar sizes\n @profile[:img_url] = result.data['image']['url']\n @profile[:img_url].gsub!(/sz=\\d+$/, \"\")\n\n @profile[:img_thumb_url] = @profile[:img_url] + 'sz=100'\n @profile[:img_tiny_url] = @profile[:img_url] + 'sz=32'\n @profile[:img_badge_url] = @profile[:img_url] + 'sz=15'\n\n return @profile\n end", "def profile\n p7sign, device_attributes = OtaEnroll::Cert.decrypt_request(request.body.read)\n icon_url = params.delete(:icon_url)\n icon_label = params.delete(:icon_label)\n callback_url, extra_data = (params.delete(:callback_url)||'').split(/\\?/)\n \n # parse callback_url extra data\n extra_data = extra_data.split(/&/).inject({}){|k, v| c=v.split(/=/);k[c[0]] = c[1];k} rescue {}\n\n data = device_attributes.inject({}){|a,(k,v)| a[k.downcase.to_sym] = v; a}.merge(params.reject{|k,v| ['controller','action'].include?(k.to_s)})\n data.merge!(extra_data)\n\n # do pingback with values and callback_secret\n query = calculate_secret(data, OtaEnroll.settings.callback_secret)\n logger.info \"callback: #{query}\" if debug?\n Net::HTTP.get(URI.parse(\"#{callback_url}?#{query}\"))\n\n certs = OtaEnroll::Tools.new\n # create payload\n\n logger.info \"profile signers \\\"#{p7sign.signers[0].issuer.to_s}\\\" == \\\"#{certs.root_cert.subject.to_s}\\\"\" if debug?\n \n if (p7sign.signers[0].issuer.to_s == certs.root_cert.subject.to_s)\n payload = OtaEnroll::Enroll.client_cert_configuration_payload(request, icon_url, icon_label)\n encrypted_profile = OpenSSL::PKCS7.encrypt(p7sign.certificates,\n payload, OpenSSL::Cipher::Cipher::new(\"des-ede3-cbc\"), OpenSSL::PKCS7::BINARY)\n configuration = OtaEnroll::Enroll.configuration_payload(request, encrypted_profile.to_der)\n else\n configuration = OtaEnroll::Enroll.encryption_cert_payload(request, \"\", scep_url)\n end\n\n logger.info \"profile configuration: #{configuration}\" if debug?\n \n sign_certs = []\n sign_certs = [certs.sign_interm_cert] if certs.sign_interm_cert.present?\n \n signed_profile = OpenSSL::PKCS7.sign(certs.ssl_cert, certs.ssl_key, configuration, sign_certs, OpenSSL::PKCS7::BINARY)\n send_data signed_profile.to_der, content_type: \"application/x-apple-aspen-config\"\n end", "def get_payment_profile(payment_profile_id, profile_id)\n @type = Type::CIM_GET_PAYMENT\n handle_payment_profile_id(payment_profile_id)\n handle_profile_id(profile_id)\n make_request\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def read_ipfixl2_profile(ipfix_l2_profile_id, opts = {})\n data, _status_code, _headers = read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts)\n data\n end", "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_user_profile(uid, user_id = uid)\n if user_id == \"system\"\n profile = Profile.new\n profile[\"name\"] = \"World\"\n return profile\n end\n\n cl = client(\"Users\", uid)\n response = cl.call(:get_user_profile, \"message\" => { \"uid\" => user_id })\n raise Error unless response.success?\n\n return response.to_hash[:get_user_profile_response][:return][:attributes].inject(Profile.new) do |memo, attr|\n memo[attr[:name]] = attr[:value]\n memo\n end\n rescue Savon::SOAPFault => e\n process_error e\n end", "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end", "def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instance_profile_id\n data.instance_profile_id\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def get_profile_url_linkedin\n profile_url = self[:info][:urls][:public_profile] if self[:info] and self[:info][:urls]\n profile_url.gsub!(/^http:/, 'https:') if profile_url # protect cookies\n profile_url\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.7228726", "0.72203064", "0.6971988", "0.69307995", "0.6919285", "0.68600434", "0.681343", "0.6773237", "0.6758999", "0.67305", "0.66180146", "0.66109884", "0.66056293", "0.65936095", "0.6586344", "0.65701485", "0.6568907", "0.65474814", "0.6527027", "0.6517917", "0.647713", "0.6468753", "0.6460488", "0.6434658", "0.63986284", "0.63889617", "0.6335652", "0.63330483", "0.6327716", "0.6327716", "0.6256404", "0.6242537", "0.6215136", "0.6185144", "0.6176553", "0.6165111", "0.61591667", "0.61527133", "0.6120841", "0.6093949", "0.60873747", "0.6072695", "0.6050724", "0.6044327", "0.6044023", "0.6037969", "0.5968485", "0.5968002", "0.5918022", "0.5908321", "0.5901775", "0.58908415", "0.5881121", "0.586789", "0.58640033", "0.58497643", "0.58466977", "0.5842589", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5840284", "0.58369625", "0.58359325", "0.5832797", "0.5831557", "0.5808309", "0.5797399", "0.57943046", "0.5767291", "0.57672065", "0.57597", "0.5752223", "0.57474947", "0.5741912", "0.57412416", "0.57366043", "0.572698", "0.57262653", "0.57252884", "0.5714246", "0.57120353", "0.57096076", "0.56992084", "0.56888145", "0.56888145", "0.5664899", "0.5659892", "0.56509256", "0.5650065", "0.56453305", "0.56347376", "0.56276417", "0.56252223", "0.5618585", "0.56166744", "0.561396" ]
0.65557253
17
Get L2 Bridge Endpoint Profile Read L2 bridge profile with ID profileid
def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0" end # resource path local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'L2BridgeEndpointProfile') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end", "def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end", "def profile; Profile.get(self.profile_id); end", "def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end", "def _profile\n @link['profile']\n end", "def get_profile(profile_id)\n @type = Type::CIM_GET_PROFILE\n handle_profile_id(profile_id)\n make_request\n end", "def profile(id, region, name)\r\n BnetApi.make_request(\"/sc2/profile/#{id}/#{region}/#{name}/\")\r\n end", "def read_l2_bridge_profile(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def get_profile\n\n # Auth\n token = auth\n\n # Get Client info based on fields provided\n client = LinkedIn::Client.new(API_KEY, API_SECRET, token)\n client.profile(:fields => @profile_fields)\n end", "def profile\n @profile ||= Profile.find_for_uid_and_network(self.uid, self.provider)\n end", "def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end", "def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('ossadapterprofile', 'get', 'KalturaOSSAdapterProfile', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end", "def profile\n @property[:profile]\n end", "def get_profile(connector, id, options={})\n brief = options.delete :brief || false\n json = connector.prepare_and_invoke_api_call(\n \"profiles/v1/providers/#{id}\" + (brief ? \"/brief\" : \"\"), :method=>:get)\n return self.new(json['profile'])\n end", "def get_app_profile instance_id, app_profile_id\n instances.get_app_profile name: app_profile_path(instance_id, app_profile_id)\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend", "def profile(profile_name:)\n claim_url = \"#{@@profile_service_url}/profile/#{profile_name}/next\"\n response = Faraday.get claim_url\n profile = JSON.parse(response.body)\n raise \"No profile available for #{profile_name}\" unless profile\n profile\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def profile\n return nil unless user_loa3\n\n mvi_response&.profile\n end", "def get_app_profile instance_id, app_profile_id\n execute do\n instances.get_app_profile(\n app_profile_path(instance_id, app_profile_id)\n )\n end\n end", "def findProfile(profile_id)\n # assuming there is only one profile with this profile_id\n @profile = Profile.where(identity: profile_id).first\n return @profile\n end", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.find(params[:id])\n\tend", "def get_profile\n self.class.get '/members/private', @options\n end", "def find_profile_id( profile_name )\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/brokerConfigurations\", :nameRepository => 'gicat'\n req.headers = @authorization_headers\n end\n\n profile_id = parse_profile_element(profile_name, response.body)\n\n return profile_id\n end", "def get_sap_profile(sap_profile_id)\n get(\"cloud-instances/#{guid}/sap/#{sap_profile_id}\")\n end", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend", "def profile_id\n Settings.cybersource.profile_id\n end", "def load_profile(params)\n db = connect()\n profile = db.execute('SELECT * FROM users WHERE Id=?', params[\"id\"])\n return profile.first\n end", "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "def profile(token, secret)\n self.access_token = self.get_access_token(token, secret)\n req = self.access_token.request(:get, PAL_EPNTS['profile_url']+PAL_EPNTS['profile_fields'],{'x-li-format' => 'json','Content-Type'=>'application/json'})\n req.body\n end", "def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end", "def get_node_profile\n rpc_get_fact_direct('node_profile')\n end", "def get_active_profile_id\n response = Faraday.get do |req|\n req.url \"#{@base_url}/services/conf/giconf/configuration\"\n req.headers = @standard_headers\n end\n\n profile_id = response.body\n return profile_id\n end", "def profile\n if @profile\n return @profile\n end\n\n @profile ||= begin\n h = profile_xml_to_hash(@catalog.search @route => @name )\n @new = false\n h\n rescue RestClient::ResourceNotFound\n # The resource is new\n @new = true\n {}\n end.freeze\n end", "def personal_profile\n RubyRedtail::Query.run(\"contacts/#{@id}/personalprofile\", @api_hash, \"GET\")\n end", "def profile\n unless @profile\n if associated_profile\n @profile = Profile.new(associated_profile)\n else\n options = {:fields => 'user_id', :includes => 'Profile'}\n options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)\n tmp = User.find(username, options)\n @profile = Profile.new(tmp.associated_profile)\n end\n end\n @profile\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('accesscontrolprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend", "def profile(profile_id, fields: nil)\n check_not_empty profile_id, 'profile_id'\n params = build_fields_params fields\n res = @connection.get profile_path(profile_id), params\n Profile.new res.body, self\n end", "def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end", "def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end", "def extract_profile(args)\n return args.shift if args.first.is_a?(Management::Profile)\n return args.pop if args.last.is_a?(Management::Profile)\n profile\n end", "def sell_shipping_profile_find (id, params={})\r\n url = api_url \"/sell/shipping_profiles/#{id}\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.get url, req \r\n end \r\n end", "def read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def user_profile(id)\n users(request(\"users/profile/#{id}.xml\", :auth => true))\n end", "def profile_url\n @data[:profile_url]\n end", "def read_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.read_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#read_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def find(participant_id:, profile_date:)\n response = request(:read_rating_profile, \"veteranId\": participant_id, \"profileDate\": profile_date)\n\n # Purposely avoiding much data processing here to do that in the application layer\n response.body[:read_rating_profile_response][:rba_profile]\n end", "def get_network_wireless_rf_profile(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'rf_profile_id' => options['rf_profile_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/wireless/rfProfiles/{rfProfileId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'rfProfileId' => options['rf_profile_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authentication_key)\n end", "def current_profile\n @profile ||= JSON.parse($redis.get(\"profile\"))\n end", "def profile(name)\n @profiles.find { |p| p.name == name }\n end", "def get_profile(id)\n \t\tfb_profile_url = FB_PROFILE + id + FB_PROFILE_FIELDS\n \t\tprofile_details = HTTParty.get(fb_profile_url)\n \t\t@first_name = profile_details[\"first_name\"]\n \t\t@last_name = profile_details[\"last_name\"]\n \t\t@profile_pic = profile_details[\"profile_pic\"]\n \t\t@locale = profile_details[\"locale\"]\n \t\t@gender = profile_details[\"gender\"]\n \tend", "def get_existing_profile(usr_prf)\n raise Utility::Errors::NotFound, \"Invalid UserProfile!\" unless usr_prf.present?\n get_prebuilt_profile(usr_prf.person_authenticated_key)\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def profile\n end", "def get_profile_ids()\n @type = Type::CIM_GET_PROFILE_IDS\n make_request\n end", "def profile_details\n # Since 15th September 2016 certificates and devices are hidden behind another request\n # see https://github.com/fastlane/fastlane/issues/6137 for more information\n @profile_details ||= client.provisioning_profile_details(provisioning_profile_id: self.id, mac: mac?)\n end", "def get_default_profile \n get(\"/profiles.json/default\")\nend", "def social_profile(provider)\n social_profiles.select{ |sp| sp.provider == provider.to_s }.first\n end", "def profile_name\n return self.profile.name\n end", "def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end", "def get_active_profile_distributor_id(profile_id)\n active_profile_request = \"#{@base_url}/services/conf/brokerConfigurations/#{profile_id}\"\n response = Faraday.get do |req|\n req.url active_profile_request\n req.headers = @authorization_headers\n end\n distributor_id = Nokogiri.XML(response.body).css(\"component id\").text\n return distributor_id\n end", "def mvp_profile\n owned_profiles.last\n end", "def xml_query_profile(xml) \n if current_user \n profile_name = (xml.root.get_elements('AccessProfile').first || empty).text \n profile_name = 'public' unless profile_name \n @profile = current_user.profiles.find_by_title(profile_name) \n return render(:text => \"<Response>bad profile</Response>\") unless @profile \n \n properties = @profile.properties.map{|p| p.property_type.title }.join(',') \n return render(:text => \"<Response>#{properties}</Response>\") \n end \n render(:text => \"<Response>Internal Error</Response>\") \n end", "def getProfile\n account = current_user.account\n if account.nil?\n render status: 400, json: {error: \"Invalid User\"}\n else\n if current_user.registered && (account.referral_code.nil? || account.referral_code.blank?)\n account.generate_referral_code\n end\n render status: 200, json: {username: current_user.username,\n email: current_user.email,\n firstName: current_user.first_name,\n lastName: current_user.last_name,\n company: current_user.company,\n balance: account.balance,\n registered: current_user.registered,\n referralCode: account.referral_code}\n end\n end", "def profile_url\n @json['profile']['url'] rescue nil\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('conversionprofile', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def profile\n @profile ||= begin\n profile_xml = repository.datastream(:pid => pid, :dsid => dsid)\n profile_xml.gsub! '<datastreamProfile', '<datastreamProfile xmlns=\"http://www.fedora.info/definitions/1/0/management/\"' unless profile_xml =~ /xmlns=/\n doc = Nokogiri::XML(profile_xml)\n h = doc.xpath('/management:datastreamProfile/*', {'management' => \"http://www.fedora.info/definitions/1/0/management/\"} ).inject({}) do |sum, node|\n sum[node.name] ||= []\n sum[node.name] << node.text\n sum\n end\n h.select { |key, value| value.length == 1 }.each do |key, value|\n h[key] = value.first\n end\n\n h\n rescue\n {}\n end\n end", "def profile\n\n end", "def profile\n if Configuration.host_based_profiles\n request_hostname\n else\n CurrentUser.user_settings[:profile].to_sym if CurrentUser.user_settings[:profile]\n end\n end", "def get_bot_profile\n bot_profile = command.event.bot.profile.on(command.event.server)\n end", "def find_profile\n @user = User.find_by_username(params[:id])\n @profile = @user.profile\n end", "def default_profile\n profiles.find_by_id(default_profile_id)\n end", "def profile\n @profile ||= repository_profile\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_profile(session, user_id)\n $client.authorization.update_token!(session[:token].to_hash)\n plus = $client.discovered_api('plus')\n\n Rails.logger.debug \"TokenPair: #{$client.authorization.to_yaml}\"\n result = $client.execute(\n :api_method => plus.people.get,\n :parameters => {'userId' => user_id})\n\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n Rails.logger.debug \"GoogleClient: NM #{result.data['displayName']}\"\n Rails.logger.debug \"GoogleClient: IM #{result.data['image']['url']}\"\n Rails.logger.debug \"GoogleClient: PR #{result.data['url']}\"\n Rails.logger.debug \"GoogleClient: ---------------------------------> \"\n\n @profile = Hash.new\n @profile[:name] = result.data['displayName']\n @profile[:profile_url] = result.data['url']\n\n # Avatar sizes\n @profile[:img_url] = result.data['image']['url']\n @profile[:img_url].gsub!(/sz=\\d+$/, \"\")\n\n @profile[:img_thumb_url] = @profile[:img_url] + 'sz=100'\n @profile[:img_tiny_url] = @profile[:img_url] + 'sz=32'\n @profile[:img_badge_url] = @profile[:img_url] + 'sz=15'\n\n return @profile\n end", "def profile\n p7sign, device_attributes = OtaEnroll::Cert.decrypt_request(request.body.read)\n icon_url = params.delete(:icon_url)\n icon_label = params.delete(:icon_label)\n callback_url, extra_data = (params.delete(:callback_url)||'').split(/\\?/)\n \n # parse callback_url extra data\n extra_data = extra_data.split(/&/).inject({}){|k, v| c=v.split(/=/);k[c[0]] = c[1];k} rescue {}\n\n data = device_attributes.inject({}){|a,(k,v)| a[k.downcase.to_sym] = v; a}.merge(params.reject{|k,v| ['controller','action'].include?(k.to_s)})\n data.merge!(extra_data)\n\n # do pingback with values and callback_secret\n query = calculate_secret(data, OtaEnroll.settings.callback_secret)\n logger.info \"callback: #{query}\" if debug?\n Net::HTTP.get(URI.parse(\"#{callback_url}?#{query}\"))\n\n certs = OtaEnroll::Tools.new\n # create payload\n\n logger.info \"profile signers \\\"#{p7sign.signers[0].issuer.to_s}\\\" == \\\"#{certs.root_cert.subject.to_s}\\\"\" if debug?\n \n if (p7sign.signers[0].issuer.to_s == certs.root_cert.subject.to_s)\n payload = OtaEnroll::Enroll.client_cert_configuration_payload(request, icon_url, icon_label)\n encrypted_profile = OpenSSL::PKCS7.encrypt(p7sign.certificates,\n payload, OpenSSL::Cipher::Cipher::new(\"des-ede3-cbc\"), OpenSSL::PKCS7::BINARY)\n configuration = OtaEnroll::Enroll.configuration_payload(request, encrypted_profile.to_der)\n else\n configuration = OtaEnroll::Enroll.encryption_cert_payload(request, \"\", scep_url)\n end\n\n logger.info \"profile configuration: #{configuration}\" if debug?\n \n sign_certs = []\n sign_certs = [certs.sign_interm_cert] if certs.sign_interm_cert.present?\n \n signed_profile = OpenSSL::PKCS7.sign(certs.ssl_cert, certs.ssl_key, configuration, sign_certs, OpenSSL::PKCS7::BINARY)\n send_data signed_profile.to_der, content_type: \"application/x-apple-aspen-config\"\n end", "def get_payment_profile(payment_profile_id, profile_id)\n @type = Type::CIM_GET_PAYMENT\n handle_payment_profile_id(payment_profile_id)\n handle_profile_id(profile_id)\n make_request\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def read_ipfixl2_profile(ipfix_l2_profile_id, opts = {})\n data, _status_code, _headers = read_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, opts)\n data\n end", "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_user_profile(uid, user_id = uid)\n if user_id == \"system\"\n profile = Profile.new\n profile[\"name\"] = \"World\"\n return profile\n end\n\n cl = client(\"Users\", uid)\n response = cl.call(:get_user_profile, \"message\" => { \"uid\" => user_id })\n raise Error unless response.success?\n\n return response.to_hash[:get_user_profile_response][:return][:attributes].inject(Profile.new) do |memo, attr|\n memo[attr[:name]] = attr[:value]\n memo\n end\n rescue Savon::SOAPFault => e\n process_error e\n end", "def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end", "def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def instance_profile_id\n data.instance_profile_id\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_sap_profiles\n sap_profiles = get(\"cloud-instances/#{guid}/sap\")[\"profiles\"] || []\n\n sap_profiles.map do |sap_profile|\n get_sap_profile(sap_profile[\"profileID\"])\n end\n end", "def get_profile_url_linkedin\n profile_url = self[:info][:urls][:public_profile] if self[:info] and self[:info][:urls]\n profile_url.gsub!(/^http:/, 'https:') if profile_url # protect cookies\n profile_url\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.7228726", "0.72203064", "0.6971988", "0.69307995", "0.6919285", "0.68600434", "0.681343", "0.6773237", "0.6758999", "0.67305", "0.66180146", "0.66109884", "0.66056293", "0.65936095", "0.6586344", "0.65701485", "0.6568907", "0.65557253", "0.65474814", "0.6527027", "0.6517917", "0.647713", "0.6468753", "0.6434658", "0.63986284", "0.63889617", "0.6335652", "0.63330483", "0.6327716", "0.6327716", "0.6256404", "0.6242537", "0.6215136", "0.6185144", "0.6176553", "0.6165111", "0.61591667", "0.61527133", "0.6120841", "0.6093949", "0.60873747", "0.6072695", "0.6050724", "0.6044327", "0.6044023", "0.6037969", "0.5968485", "0.5968002", "0.5918022", "0.5908321", "0.5901775", "0.58908415", "0.5881121", "0.586789", "0.58640033", "0.58497643", "0.58466977", "0.5842589", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5841625", "0.5840284", "0.58369625", "0.58359325", "0.5832797", "0.5831557", "0.5808309", "0.5797399", "0.57943046", "0.5767291", "0.57672065", "0.57597", "0.5752223", "0.57474947", "0.5741912", "0.57412416", "0.57366043", "0.572698", "0.57262653", "0.57252884", "0.5714246", "0.57120353", "0.57096076", "0.56992084", "0.56888145", "0.56888145", "0.5664899", "0.5659892", "0.56509256", "0.5650065", "0.56453305", "0.56347376", "0.56276417", "0.56252223", "0.5618585", "0.56166744", "0.561396" ]
0.6460488
23
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end" ]
[ "0.74398065", "0.74231076", "0.72141737", "0.7182919", "0.7162661", "0.713989", "0.68753177", "0.67805517", "0.6753361", "0.65237695", "0.64346457", "0.6292789", "0.6265245", "0.6153511", "0.60907227", "0.6079858", "0.60353255", "0.6019991", "0.5993825", "0.5971388", "0.5951406", "0.5939088", "0.59215426", "0.5885779", "0.58820355", "0.5866013", "0.5865107", "0.5856147", "0.5840359", "0.58164275", "0.57660294", "0.57412755", "0.5740913", "0.57408035", "0.5738951", "0.57275945", "0.5719054", "0.5707963", "0.56966096", "0.5695739", "0.5694527", "0.568879", "0.56802183", "0.5642229", "0.56365323", "0.561574", "0.56079674", "0.5606833", "0.55969834", "0.5591564", "0.5589847", "0.5586701", "0.5585094", "0.5576282", "0.55581254", "0.55576646", "0.5553215", "0.5545757", "0.5542619", "0.55323046", "0.5531375", "0.55183554", "0.5514258", "0.55070627", "0.55040896", "0.54946774", "0.5476864", "0.5474412", "0.5470673", "0.5463301", "0.5462803", "0.54600567", "0.5444794", "0.5439604", "0.543659", "0.54334223", "0.5429661", "0.5420206", "0.5411482", "0.5410591", "0.5403602", "0.5403602", "0.5400964", "0.54002094", "0.53989834", "0.5391938", "0.53908545", "0.5386149", "0.5368822", "0.53686315", "0.5366533", "0.5366533", "0.53641397", "0.53635544", "0.535364", "0.5348701", "0.5347901", "0.5346504", "0.5337149", "0.5336918" ]
0.6525983
9
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile" end # verify the required parameter 'l2_bridge_endpoint_profile' is set if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil? fail ArgumentError, "Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile" end # resource path local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'L2BridgeEndpointProfile') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end" ]
[ "0.74238", "0.72147363", "0.7183777", "0.7162514", "0.7139919", "0.68746734", "0.6780593", "0.67534924", "0.6525527", "0.65236706", "0.6434839", "0.6292552", "0.626511", "0.6154161", "0.60921836", "0.6080533", "0.6035727", "0.60206205", "0.59959066", "0.59720224", "0.5951914", "0.5939488", "0.59222174", "0.5884961", "0.58840495", "0.5865786", "0.5865397", "0.5857602", "0.5840359", "0.5815438", "0.5767913", "0.57437617", "0.57418406", "0.57417953", "0.57398397", "0.57296133", "0.57195044", "0.5709047", "0.5697537", "0.56966907", "0.5696481", "0.5689101", "0.5680501", "0.56426924", "0.5637506", "0.56171715", "0.5608636", "0.5607953", "0.5597087", "0.559252", "0.5591264", "0.55876607", "0.55850846", "0.5578132", "0.5558909", "0.55584973", "0.5554579", "0.5547443", "0.55443037", "0.5533041", "0.5532987", "0.55202997", "0.551566", "0.5509342", "0.5506234", "0.5495581", "0.54787", "0.54767644", "0.5472666", "0.5464097", "0.5463158", "0.5462026", "0.54461914", "0.54401666", "0.5436194", "0.5435556", "0.54306036", "0.5421809", "0.54123473", "0.54113185", "0.5405007", "0.5405007", "0.5402049", "0.54015094", "0.53993964", "0.53938705", "0.5392483", "0.53877854", "0.53702444", "0.5367119", "0.5367119", "0.5366182", "0.53653723", "0.53642815", "0.53544635", "0.53503484", "0.5347808", "0.53467786", "0.5338933", "0.5336845" ]
0.7440173
0
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.74412334", "0.7424626", "0.7215516", "0.7184345", "0.714014", "0.68752944", "0.6781651", "0.675443", "0.65255797", "0.6524788", "0.6435752", "0.6294121", "0.6266573", "0.61533517", "0.6092006", "0.6080814", "0.6036426", "0.6019085", "0.5995237", "0.59725", "0.59515077", "0.5940472", "0.59208083", "0.5884632", "0.5882417", "0.5866951", "0.58664817", "0.58553976", "0.5841387", "0.581515", "0.5765931", "0.5742741", "0.5741904", "0.57401806", "0.574001", "0.57275254", "0.57204556", "0.5707345", "0.56976545", "0.56958544", "0.56947684", "0.56902504", "0.5680287", "0.5641379", "0.5637104", "0.56158096", "0.56087154", "0.5608543", "0.5598655", "0.559071", "0.5589894", "0.5588474", "0.5586771", "0.55762297", "0.55584395", "0.5557657", "0.5552587", "0.5545949", "0.5542954", "0.5532874", "0.55312556", "0.551784", "0.5514849", "0.5507142", "0.55038387", "0.5493892", "0.54776937", "0.5475227", "0.54703146", "0.54627556", "0.5462196", "0.5459615", "0.5445112", "0.5439366", "0.5436724", "0.5433004", "0.5428744", "0.5419726", "0.5412837", "0.54107916", "0.5403232", "0.5403232", "0.54013556", "0.54006004", "0.5399509", "0.53922045", "0.5390843", "0.53858066", "0.5368499", "0.5366836", "0.53665644", "0.53665644", "0.5364248", "0.53634113", "0.53541064", "0.53484565", "0.5347041", "0.53460735", "0.53375775", "0.5337448" ]
0.7162582
4
Create or update L2 Bridge Endpoint Profile API will create or update L2 bridge profile with ID profileid. L2 Bridge profile is only allowed under an enforcementpoint with path /infra/sites/default/enforcementpoints/default.
def update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0 ...' end # verify the required parameter 'site_id' is set if @api_client.config.client_side_validation && site_id.nil? fail ArgumentError, "Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0" end # verify the required parameter 'enforcement_point_id' is set if @api_client.config.client_side_validation && enforcement_point_id.nil? fail ArgumentError, "Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0" end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0" end # verify the required parameter 'l2_bridge_endpoint_profile' is set if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil? fail ArgumentError, "Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile_0" end # resource path local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'L2BridgeEndpointProfile') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.update_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#update_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # verify the required parameter 'l2_bridge_endpoint_profile' is set\n if @api_client.config.client_side_validation && l2_bridge_endpoint_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'l2_bridge_endpoint_profile' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.patch_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(l2_bridge_endpoint_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#patch_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def patch_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def patch_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n patch_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n nil\n end", "def create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.create_or_replace_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2Profile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#create_or_replace_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_l2_bridge_profile(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts = {})\n data, _status_code, _headers = update_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, l2_bridge_endpoint_profile, opts)\n data\n end", "def delete_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def delete_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.delete_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#delete_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.create_or_replace_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXL2CollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#create_or_replace_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def update_profile\n @profile = @account.employee\n \n if params[:profile].present?\n @profile.assign_attributes(profile_params)\n @profile.save\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {success: 'Profile has been updated successfully.'}\n else\n redirect_to gns_core.my_profile_backend_accounts_path, flash: {error: 'Profile update failed. Please try again!'}\n end\n end", "def create_sslprofile\n converge_by(\"Create #{new_resource} ssl profile\") do\n Chef::Log.info \"Create #{new_resource} ssl profile\"\n\n\n load_balancer.client['LocalLB.ProfileClientSSL'].create_v2([new_resource.sslprofile_name], [{\"value\" => \"/Common/#{new_resource.keyid}\", \"default_flag\" => \"false\"}] , [{\"value\" => \"/Common/#{new_resource.certid}\", \"default_flag\" => \"false\"}])\n load_balancer.client['LocalLB.ProfileClientSSL'].set_passphrase([\"/Common/#{new_resource.sslprofile_name}\"], [{\"value\" => \"#{new_resource.passphrase}\", \"default_flag\" => \"false\" }]) if !new_resource.passphrase.nil?\n\n current_resource.keyid(new_resource.keyid)\n current_resource.certid(new_resource.certid)\n current_resource.cacertid(new_resource.cacertid)\n current_resource.passphrase(new_resource.passphrase)\n\n new_resource.updated_by_last_action(true)\n end\n end", "def read_l2_bridge_profile_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile\"\n end\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend", "def read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # verify the required parameter 'profile_id' is set\n if @api_client.config.client_side_validation && profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'profile_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.read_l2_bridge_profile_0\"\n end\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles/{profile-id}'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s).sub('{' + 'profile-id' + '}', profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#read_l2_bridge_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def newprofile\n if params[\"auth_key\"] == nil or params[\"device_id\"] == nil or params[\"profile_url\"] == nil\n render :json => '{\"status\": \"failed\", \"reason\": \"incorrect parameters\"}'\n else\n device = Device.find(params[\"device_id\"])\n if device.auth_key == params[\"auth_key\"]\n device.profile_url = params[\"profile_url\"]\n if device.save\n render :json => '{\"status\": \"success\"}'\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"save error\"}'\n end\n else\n render :json => '{\"status\": \"failed\", \"reason\": \"not authorized\"}'\n end\n end\n end", "def patch_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_or_replace_ipfixl2_profile_0(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_0_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile ...'\n end\n # verify the required parameter 'ipfix_l2_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # verify the required parameter 'ipfixl2_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_profile' when calling PolicyOperationsIPFIXSwitchIPFIXProfilesApi.patch_ipfixl2_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-profiles/{ipfix-l2-profile-id}'.sub('{' + 'ipfix-l2-profile-id' + '}', ipfix_l2_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXProfilesApi#patch_ipfixl2_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def list_l2_bridge_profiles_0_with_http_info(site_id, enforcement_point_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0 ...'\n end\n # verify the required parameter 'site_id' is set\n if @api_client.config.client_side_validation && site_id.nil?\n fail ArgumentError, \"Missing the required parameter 'site_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n # verify the required parameter 'enforcement_point_id' is set\n if @api_client.config.client_side_validation && enforcement_point_id.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_id' when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi.list_l2_bridge_profiles_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/sites/{site-id}/enforcement-points/{enforcement-point-id}/edge-bridge-profiles'.sub('{' + 'site-id' + '}', site_id.to_s).sub('{' + 'enforcement-point-id' + '}', enforcement_point_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'L2BridgeEndpointProfileListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsEdgeBridgeProfilesApi#list_l2_bridge_profiles_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_profile(ipfix_l2_profile_id, ipfixl2_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_profile_with_http_info(ipfix_l2_profile_id, ipfixl2_profile, opts)\n data\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfix_collector_profile_0_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def update_profile(params)\n post('/account/update_profile.json', params)\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_port_security_profile_binding_0_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create_or_replace_ipfix_collector_profile_with_http_info(ipfix_collector_profile_id, ipfix_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile ...'\n end\n # verify the required parameter 'ipfix_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile_id' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # verify the required parameter 'ipfix_collector_profile' is set\n if @api_client.config.client_side_validation && ipfix_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_collector_profile' when calling PolicyOperationsIPFIXIPFIXCollectorProfilesApi.create_or_replace_ipfix_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-collector-profiles/{ipfix-collector-profile-id}'.sub('{' + 'ipfix-collector-profile-id' + '}', ipfix_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfix_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPFIXCollectorProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXIPFIXCollectorProfilesApi#create_or_replace_ipfix_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "def create_or_update_port_security_profile_binding_with_http_info(tier_1_id, segment_id, port_id, port_security_profile_binding_map_id, port_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_id' is set\n if @api_client.config.client_side_validation && port_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # verify the required parameter 'port_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && port_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'port_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_port_security_profile_binding\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}/port-security-profile-binding-maps/{port-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s).sub('{' + 'port-security-profile-binding-map-id' + '}', port_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(port_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PortSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_port_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def update_profile\n @profile = Profile.find(params[:id])\n @profile.update_attribute(:field_name,params[:field_name])\n @profile.update_attribute(:field_type,params[:field_type])\n redirect_to(\"/profiles/create_profile/#{@profile.structure_component_id}\")\n end", "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_update_segment_security_profile_binding_0_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding_0\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update_profile(profile)\n @type = Type::CIM_UPDATE_PROFILE\n @fields.merge!(profile.to_hash)\n make_request\n end", "def patch_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0 ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def create_or_update_segment_security_profile_binding_with_http_info(tier_1_id, segment_id, segment_security_profile_binding_map_id, segment_security_profile_binding_map, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_id' is set\n if @api_client.config.client_side_validation && segment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map_id' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map_id.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map_id' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # verify the required parameter 'segment_security_profile_binding_map' is set\n if @api_client.config.client_side_validation && segment_security_profile_binding_map.nil?\n fail ArgumentError, \"Missing the required parameter 'segment_security_profile_binding_map' when calling PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi.create_or_update_segment_security_profile_binding\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/segment-security-profile-binding-maps/{segment-security-profile-binding-map-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'segment-security-profile-binding-map-id' + '}', segment_security_profile_binding_map_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(segment_security_profile_binding_map)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SegmentSecurityProfileBindingMap')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivitySegmentsSegmentProfilesSegmentSecurityProfileBindingApi#create_or_update_segment_security_profile_binding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def patch_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile ...'\n end\n # verify the required parameter 'ipfix_l2_collector_profile_id' is set\n if @api_client.config.client_side_validation && ipfix_l2_collector_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfix_l2_collector_profile_id' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # verify the required parameter 'ipfixl2_collector_profile' is set\n if @api_client.config.client_side_validation && ipfixl2_collector_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'ipfixl2_collector_profile' when calling PolicyOperationsIPFIXSwitchIPFIXCollectorsApi.patch_ipfixl2_collector_profile\"\n end\n # resource path\n local_var_path = '/infra/ipfix-l2-collector-profiles/{ipfix-l2-collector-profile-id}'.sub('{' + 'ipfix-l2-collector-profile-id' + '}', ipfix_l2_collector_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(ipfixl2_collector_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyOperationsIPFIXSwitchIPFIXCollectorsApi#patch_ipfixl2_collector_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def create\n @profile = Profile.new profile_params\n unless current_user.profile\n @profile.user = current_user\n end\n\n respond_to do |format|\n if @profile.save\n if current_user.profile\n AclEntry.set current_user, @profile, :edit\n end\n FeedSubscription.add current_user.profile, @profile\n\n format.html { redirect_to session_path }\n format.xml { render xml: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n if @profile.save\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.update(bank_id: response_bank.id)\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n if response_recipient.id.present?\n @profile.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil salvo com sucesso.'\n end\n end\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.' \n else\n redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def release_profile(profile_id:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_id}/release\", {}\n rescue StandardError => e\n puts \"Error releasing profile : #{e.message}\"\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end", "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "def create\n @profile_attribute = current_user.profile_attributes.new(params[:profile_attribute])\n @profile = Profile.find params[:profile_id]\n @profile.profile_attributes << @profile_attribute\n\n respond_to do |format|\n if @profile_attribute.save\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully created.') }\n format.xml { render :xml => @profile_attribute, :status => :created, :location => @profile_attribute }\n format.json { render :json => @profile_attribute, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.find params[:profile_id]\n @update = @profile.updates.new(update_params)\n\n respond_to do |format|\n if @update.save\n format.html { redirect_to update_path(@update), notice: 'Update was successfully created.' }\n format.json { render :show, status: :created, location: @update }\n else\n format.html { render :new }\n format.json { render json: @update.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def read_l2_bridge_profile_0(site_id, enforcement_point_id, profile_id, opts = {})\n data, _status_code, _headers = read_l2_bridge_profile_0_with_http_info(site_id, enforcement_point_id, profile_id, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if !@profile.valid?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end", "def save_profile\n @structure_component = StructureComponent.find(params[:id])\n @profile = Profile.new\n @profile.field_name = params[:field_name]\n @profile.field_type = params[:field_type]\n @profile.structure_component_id = @structure_component.id\n @profile.tenant_id = @structure_component.tenant_id\n @profile.save\n @structure_component.update_attribute(:is_saved, \"true\")\n redirect_to(\"/profiles/create_profile/#{@structure_component.id}\")\n end", "def save_or_create_profile\n if profile.present?\n profile.actor_id = id\n profile.save!\n else\n create_profile\n end\n end", "def update!(**args)\n @is_bluetooth_connected_profile_required = args[:is_bluetooth_connected_profile_required] if args.key?(:is_bluetooth_connected_profile_required)\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def update_profile(params)\n post 'account/update_profile', :post => params\n end", "def set_profile\n id = params[:id]\n @profile = Profile.find(id)\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n current_user.add_role :candidate\n # Send notification to new user that his candidate profile has been created\n RegistrationMailer.registration(@profile.user.id).deliver_now\n\n # Send notification to MOBEEAS Admin that a new candidate user has been created\n RegistrationMailer.new_user_notification(@profile.user.id).deliver_now\n\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_create_or_update_policy_context_profile_0_with_http_info(context_profile_id, policy_context_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0 ...'\n end\n # verify the required parameter 'context_profile_id' is set\n if @api_client.config.client_side_validation && context_profile_id.nil?\n fail ArgumentError, \"Missing the required parameter 'context_profile_id' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # verify the required parameter 'policy_context_profile' is set\n if @api_client.config.client_side_validation && policy_context_profile.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_context_profile' when calling PolicyInventoryContextProfilesApi.patch_create_or_update_policy_context_profile_0\"\n end\n # resource path\n local_var_path = '/global-infra/context-profiles/{context-profile-id}'.sub('{' + 'context-profile-id' + '}', context_profile_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'override'] = opts[:'override'] if !opts[:'override'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_context_profile)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInventoryContextProfilesApi#patch_create_or_update_policy_context_profile_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create_or_replace_ipfixl2_collector_profile_0(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_0_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_profile\n @user_profile = @user.user_profile\n @user_profile = @user.create_user_profile if @user_profile.nil?\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def bridges_create_or_update_with_id(bridge_id, params = {})\n post \"bridges/#{bridge_id}\", params\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def set_profile\n @profile = Profile.friendly.find(params[:id])\n end", "def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end", "def add_to_profile(profile_name:, profile_data:)\n Faraday.post \"#{@@profile_service_url}/profile/#{profile_name}\", profile_data\n rescue StandardError => e\n puts \"Error adding to profile : #{e.message}\"\n end", "def update\n if @profile.update_attributes(profile_params)\n begin\n response_bank = Pagarme::CreateBankAccountService.new(profile: @profile).call\n rescue\n return redirect_to new_client_profile_path, notice: 'Houve um problema para salvar o perfil.'\n end\n if response_bank.id.present?\n @profile.reload.update(bank_id: response_bank.id)\n if @profile.recipient_id.blank?\n response_recipient = Pagarme::CreateRecipientService.new(profile: @profile).call\n else\n response_recipient = Pagarme::UpdateRecipientService.new(profile: @profile).call\n end\n if response_recipient.id.present?\n @profile.reload.update(recipient_id: response_recipient.id)\n return redirect_to edit_client_profile_path(@profile), notice: 'Perfil atualizado com sucesso.'\n end\n end\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n else\n redirect_to edit_client_profile_path(@profile), notice: 'Houve um problema para salvar o perfil.'\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_or_replace_ipfixl2_collector_profile(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts = {})\n data, _status_code, _headers = create_or_replace_ipfixl2_collector_profile_with_http_info(ipfix_l2_collector_profile_id, ipfixl2_collector_profile, opts)\n data\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_profile(params = {})\n response = post('account/update_profile.json', params)\n Croudia::Object::User.new(response)\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7441519", "0.7215665", "0.71844035", "0.71624964", "0.7139739", "0.6875108", "0.6781137", "0.67538905", "0.65258217", "0.65243983", "0.64351976", "0.629415", "0.6266634", "0.615254", "0.60908175", "0.60808843", "0.6036305", "0.60189813", "0.5993805", "0.5972299", "0.595081", "0.5939249", "0.592011", "0.5884279", "0.5881234", "0.5867416", "0.5865258", "0.58550674", "0.5841651", "0.5814916", "0.5764511", "0.57419753", "0.57410306", "0.57390124", "0.57388824", "0.5727177", "0.5721029", "0.5707631", "0.5696996", "0.5695698", "0.56935227", "0.5690842", "0.5679706", "0.56408936", "0.5636206", "0.5614883", "0.5608914", "0.56066567", "0.5597951", "0.55897784", "0.55894226", "0.55888826", "0.55860025", "0.5575634", "0.5557447", "0.55566996", "0.55515826", "0.55454874", "0.5541902", "0.5530748", "0.55307156", "0.5516991", "0.5513736", "0.5506776", "0.550363", "0.54928875", "0.54765165", "0.54746294", "0.5469502", "0.5462197", "0.546182", "0.5458808", "0.5444364", "0.543848", "0.54375106", "0.5432497", "0.542788", "0.54194665", "0.5411742", "0.54080874", "0.5401888", "0.5401888", "0.5400266", "0.5399945", "0.5399636", "0.5391092", "0.5389816", "0.53855985", "0.5368127", "0.53671545", "0.536428", "0.536428", "0.53628296", "0.536263", "0.53532255", "0.53474253", "0.5347113", "0.534471", "0.53362644", "0.5335988" ]
0.7424836
1