azure_mgmt_relay 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ecb17faf6376c8403dc29cbbda18adebd5fc0e8
4
- data.tar.gz: a5f620984d1e36d3d43291dd5a95e32da236fdae
3
+ metadata.gz: 55fdb170202c0169e0b0f6ac36f597158b8bdb77
4
+ data.tar.gz: f31fe6f38c78ce494bd3edb588daf0ef525a7036
5
5
  SHA512:
6
- metadata.gz: 2955fe6a195bef85464a97935e7490fa0f10ea4d0de654c539a77b83a5bd91ff221c8b3362556422cc93cfd6b5dd521f62195620c8d7a9a4377ca6ebe295d3cb
7
- data.tar.gz: 6cf0068dd2498fb4b50ad74ed684ad4f7586d15c8956a000abe814220d4ad5ac19c04d4bcf32c6e3d51ea72995fb884b69e2c1285e0c25a15878de5830b1bd52
6
+ metadata.gz: e9c78fb1fbac911dad23924643d0ad3ccb2d95f31910e2618e0f42c684f4a098f5996cf8cae8ee723fe200db05b0e745c1427b69a497ca9f3fb4b49d4cebf75f
7
+ data.tar.gz: 4678ef0ab0d3ffeed121d89c8910bc3423fad3bf1a03d7764fc90fd361ba1b82181d8166ba7f9d49c5c551634a334bf02f67286715ed4777ae7eaea47994c87c
@@ -544,6 +544,111 @@ module Azure::Relay::Mgmt::V2016_07_01
544
544
  promise.execute
545
545
  end
546
546
 
547
+ #
548
+ # Authorization rules for a HybridConnection.
549
+ #
550
+ # @param resource_group_name [String] Name of the Resource group within the
551
+ # Azure subscription.
552
+ # @param namespace_name [String] The Namespace Name
553
+ # @param hybrid_connection_name [String] The hybrid connection name.
554
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
555
+ # will be added to the HTTP request.
556
+ #
557
+ # @return [Array<AuthorizationRule>] operation results.
558
+ #
559
+ def list_post_authorization_rules(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
560
+ first_page = list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers)
561
+ first_page.get_all_items
562
+ end
563
+
564
+ #
565
+ # Authorization rules for a HybridConnection.
566
+ #
567
+ # @param resource_group_name [String] Name of the Resource group within the
568
+ # Azure subscription.
569
+ # @param namespace_name [String] The Namespace Name
570
+ # @param hybrid_connection_name [String] The hybrid connection name.
571
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
572
+ # will be added to the HTTP request.
573
+ #
574
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
575
+ #
576
+ def list_post_authorization_rules_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
577
+ list_post_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers).value!
578
+ end
579
+
580
+ #
581
+ # Authorization rules for a HybridConnection.
582
+ #
583
+ # @param resource_group_name [String] Name of the Resource group within the
584
+ # Azure subscription.
585
+ # @param namespace_name [String] The Namespace Name
586
+ # @param hybrid_connection_name [String] The hybrid connection name.
587
+ # @param [Hash{String => String}] A hash of custom headers that will be added
588
+ # to the HTTP request.
589
+ #
590
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
591
+ #
592
+ def list_post_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
593
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
594
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
595
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
596
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
597
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
598
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
599
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
600
+ fail ArgumentError, "'hybrid_connection_name' should satisfy the constraint - 'MaxLength': '50'" if !hybrid_connection_name.nil? && hybrid_connection_name.length > 50
601
+ fail ArgumentError, "'hybrid_connection_name' should satisfy the constraint - 'MinLength': '1'" if !hybrid_connection_name.nil? && hybrid_connection_name.length < 1
602
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
603
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
604
+
605
+
606
+ request_headers = {}
607
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
608
+
609
+ # Set Headers
610
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
611
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
612
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules'
613
+
614
+ request_url = @base_url || @client.base_url
615
+
616
+ options = {
617
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
618
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'subscriptionId' => @client.subscription_id},
619
+ query_params: {'api-version' => @client.api_version},
620
+ headers: request_headers.merge(custom_headers || {}),
621
+ base_url: request_url
622
+ }
623
+ promise = @client.make_request_async(:post, path_template, options)
624
+
625
+ promise = promise.then do |result|
626
+ http_response = result.response
627
+ status_code = http_response.status
628
+ response_content = http_response.body
629
+ unless status_code == 200
630
+ error_model = JSON.load(response_content)
631
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
632
+ end
633
+
634
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
635
+ # Deserialize Response
636
+ if status_code == 200
637
+ begin
638
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
639
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
640
+ result.body = @client.deserialize(result_mapper, parsed_response)
641
+ rescue Exception => e
642
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
643
+ end
644
+ end
645
+
646
+ result
647
+ end
648
+
649
+ promise.execute
650
+ end
651
+
547
652
  #
548
653
  # Creates or Updates an authorization rule for a HybridConnection
549
654
  #
@@ -877,6 +982,117 @@ module Azure::Relay::Mgmt::V2016_07_01
877
982
  promise.execute
878
983
  end
879
984
 
985
+ #
986
+ # HybridConnection authorizationRule for a HybridConnection by name.
987
+ #
988
+ # @param resource_group_name [String] Name of the Resource group within the
989
+ # Azure subscription.
990
+ # @param namespace_name [String] The Namespace Name
991
+ # @param hybrid_connection_name [String] The hybrid connection name.
992
+ # @param authorization_rule_name [String] The authorizationRule name.
993
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
994
+ # will be added to the HTTP request.
995
+ #
996
+ # @return [AuthorizationRule] operation results.
997
+ #
998
+ def post_authorization_rule(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers:nil)
999
+ response = post_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers:custom_headers).value!
1000
+ response.body unless response.nil?
1001
+ end
1002
+
1003
+ #
1004
+ # HybridConnection authorizationRule for a HybridConnection by name.
1005
+ #
1006
+ # @param resource_group_name [String] Name of the Resource group within the
1007
+ # Azure subscription.
1008
+ # @param namespace_name [String] The Namespace Name
1009
+ # @param hybrid_connection_name [String] The hybrid connection name.
1010
+ # @param authorization_rule_name [String] The authorizationRule name.
1011
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1012
+ # will be added to the HTTP request.
1013
+ #
1014
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1015
+ #
1016
+ def post_authorization_rule_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers:nil)
1017
+ post_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers:custom_headers).value!
1018
+ end
1019
+
1020
+ #
1021
+ # HybridConnection authorizationRule for a HybridConnection by name.
1022
+ #
1023
+ # @param resource_group_name [String] Name of the Resource group within the
1024
+ # Azure subscription.
1025
+ # @param namespace_name [String] The Namespace Name
1026
+ # @param hybrid_connection_name [String] The hybrid connection name.
1027
+ # @param authorization_rule_name [String] The authorizationRule name.
1028
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1029
+ # to the HTTP request.
1030
+ #
1031
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1032
+ #
1033
+ def post_authorization_rule_async(resource_group_name, namespace_name, hybrid_connection_name, authorization_rule_name, custom_headers:nil)
1034
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1035
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1036
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1037
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1038
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1039
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1040
+ fail ArgumentError, 'hybrid_connection_name is nil' if hybrid_connection_name.nil?
1041
+ fail ArgumentError, "'hybrid_connection_name' should satisfy the constraint - 'MaxLength': '50'" if !hybrid_connection_name.nil? && hybrid_connection_name.length > 50
1042
+ fail ArgumentError, "'hybrid_connection_name' should satisfy the constraint - 'MinLength': '1'" if !hybrid_connection_name.nil? && hybrid_connection_name.length < 1
1043
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1044
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
1045
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1046
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1047
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1048
+
1049
+
1050
+ request_headers = {}
1051
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1052
+
1053
+ # Set Headers
1054
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1055
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1056
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/HybridConnections/{hybridConnectionName}/authorizationRules/{authorizationRuleName}'
1057
+
1058
+ request_url = @base_url || @client.base_url
1059
+
1060
+ options = {
1061
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1062
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'hybridConnectionName' => hybrid_connection_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1063
+ query_params: {'api-version' => @client.api_version},
1064
+ headers: request_headers.merge(custom_headers || {}),
1065
+ base_url: request_url
1066
+ }
1067
+ promise = @client.make_request_async(:post, path_template, options)
1068
+
1069
+ promise = promise.then do |result|
1070
+ http_response = result.response
1071
+ status_code = http_response.status
1072
+ response_content = http_response.body
1073
+ unless status_code == 200
1074
+ error_model = JSON.load(response_content)
1075
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1076
+ end
1077
+
1078
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1079
+ # Deserialize Response
1080
+ if status_code == 200
1081
+ begin
1082
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1083
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRule.mapper()
1084
+ result.body = @client.deserialize(result_mapper, parsed_response)
1085
+ rescue Exception => e
1086
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1087
+ end
1088
+ end
1089
+
1090
+ result
1091
+ end
1092
+
1093
+ promise.execute
1094
+ end
1095
+
880
1096
  #
881
1097
  # Primary and Secondary ConnectionStrings to the HybridConnection.
882
1098
  #
@@ -1292,6 +1508,94 @@ module Azure::Relay::Mgmt::V2016_07_01
1292
1508
  promise.execute
1293
1509
  end
1294
1510
 
1511
+ #
1512
+ # Authorization rules for a HybridConnection.
1513
+ #
1514
+ # @param next_page_link [String] The NextLink from the previous successful call
1515
+ # to List operation.
1516
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1517
+ # will be added to the HTTP request.
1518
+ #
1519
+ # @return [AuthorizationRuleListResult] operation results.
1520
+ #
1521
+ def list_post_authorization_rules_next(next_page_link, custom_headers:nil)
1522
+ response = list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1523
+ response.body unless response.nil?
1524
+ end
1525
+
1526
+ #
1527
+ # Authorization rules for a HybridConnection.
1528
+ #
1529
+ # @param next_page_link [String] The NextLink from the previous successful call
1530
+ # to List operation.
1531
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1532
+ # will be added to the HTTP request.
1533
+ #
1534
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1535
+ #
1536
+ def list_post_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1537
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1538
+ end
1539
+
1540
+ #
1541
+ # Authorization rules for a HybridConnection.
1542
+ #
1543
+ # @param next_page_link [String] The NextLink from the previous successful call
1544
+ # to List operation.
1545
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1546
+ # to the HTTP request.
1547
+ #
1548
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1549
+ #
1550
+ def list_post_authorization_rules_next_async(next_page_link, custom_headers:nil)
1551
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1552
+
1553
+
1554
+ request_headers = {}
1555
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1556
+
1557
+ # Set Headers
1558
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1559
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1560
+ path_template = '{nextLink}'
1561
+
1562
+ request_url = @base_url || @client.base_url
1563
+
1564
+ options = {
1565
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1566
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1567
+ headers: request_headers.merge(custom_headers || {}),
1568
+ base_url: request_url
1569
+ }
1570
+ promise = @client.make_request_async(:post, path_template, options)
1571
+
1572
+ promise = promise.then do |result|
1573
+ http_response = result.response
1574
+ status_code = http_response.status
1575
+ response_content = http_response.body
1576
+ unless status_code == 200
1577
+ error_model = JSON.load(response_content)
1578
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1579
+ end
1580
+
1581
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1582
+ # Deserialize Response
1583
+ if status_code == 200
1584
+ begin
1585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1586
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
1587
+ result.body = @client.deserialize(result_mapper, parsed_response)
1588
+ rescue Exception => e
1589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1590
+ end
1591
+ end
1592
+
1593
+ result
1594
+ end
1595
+
1596
+ promise.execute
1597
+ end
1598
+
1295
1599
  #
1296
1600
  # Lists the HybridConnection within the namespace.
1297
1601
  #
@@ -1339,5 +1643,29 @@ module Azure::Relay::Mgmt::V2016_07_01
1339
1643
  end
1340
1644
  end
1341
1645
 
1646
+ #
1647
+ # Authorization rules for a HybridConnection.
1648
+ #
1649
+ # @param resource_group_name [String] Name of the Resource group within the
1650
+ # Azure subscription.
1651
+ # @param namespace_name [String] The Namespace Name
1652
+ # @param hybrid_connection_name [String] The hybrid connection name.
1653
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1654
+ # will be added to the HTTP request.
1655
+ #
1656
+ # @return [AuthorizationRuleListResult] which provide lazy access to pages of
1657
+ # the response.
1658
+ #
1659
+ def list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
1660
+ response = list_post_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers).value!
1661
+ unless response.nil?
1662
+ page = response.body
1663
+ page.next_method = Proc.new do |next_page_link|
1664
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
1665
+ end
1666
+ page
1667
+ end
1668
+ end
1669
+
1342
1670
  end
1343
1671
  end
@@ -703,6 +703,105 @@ module Azure::Relay::Mgmt::V2016_07_01
703
703
  promise.execute
704
704
  end
705
705
 
706
+ #
707
+ # Authorization rules for a namespace.
708
+ #
709
+ # @param resource_group_name [String] Name of the Resource group within the
710
+ # Azure subscription.
711
+ # @param namespace_name [String] The Namespace Name
712
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
713
+ # will be added to the HTTP request.
714
+ #
715
+ # @return [Array<AuthorizationRule>] operation results.
716
+ #
717
+ def list_post_authorization_rules(resource_group_name, namespace_name, custom_headers:nil)
718
+ first_page = list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
719
+ first_page.get_all_items
720
+ end
721
+
722
+ #
723
+ # Authorization rules for a namespace.
724
+ #
725
+ # @param resource_group_name [String] Name of the Resource group within the
726
+ # Azure subscription.
727
+ # @param namespace_name [String] The Namespace Name
728
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
729
+ # will be added to the HTTP request.
730
+ #
731
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
732
+ #
733
+ def list_post_authorization_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
734
+ list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
735
+ end
736
+
737
+ #
738
+ # Authorization rules for a namespace.
739
+ #
740
+ # @param resource_group_name [String] Name of the Resource group within the
741
+ # Azure subscription.
742
+ # @param namespace_name [String] The Namespace Name
743
+ # @param [Hash{String => String}] A hash of custom headers that will be added
744
+ # to the HTTP request.
745
+ #
746
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
747
+ #
748
+ def list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:nil)
749
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
750
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
751
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
752
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
753
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
754
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
755
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
756
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
757
+
758
+
759
+ request_headers = {}
760
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
761
+
762
+ # Set Headers
763
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
764
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
765
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/AuthorizationRules'
766
+
767
+ request_url = @base_url || @client.base_url
768
+
769
+ options = {
770
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
771
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
772
+ query_params: {'api-version' => @client.api_version},
773
+ headers: request_headers.merge(custom_headers || {}),
774
+ base_url: request_url
775
+ }
776
+ promise = @client.make_request_async(:post, path_template, options)
777
+
778
+ promise = promise.then do |result|
779
+ http_response = result.response
780
+ status_code = http_response.status
781
+ response_content = http_response.body
782
+ unless status_code == 200
783
+ error_model = JSON.load(response_content)
784
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
785
+ end
786
+
787
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
788
+ # Deserialize Response
789
+ if status_code == 200
790
+ begin
791
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
792
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
793
+ result.body = @client.deserialize(result_mapper, parsed_response)
794
+ rescue Exception => e
795
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
796
+ end
797
+ end
798
+
799
+ result
800
+ end
801
+
802
+ promise.execute
803
+ end
804
+
706
805
  #
707
806
  # Creates or Updates an authorization rule for a namespace
708
807
  #
@@ -1018,6 +1117,111 @@ module Azure::Relay::Mgmt::V2016_07_01
1018
1117
  promise.execute
1019
1118
  end
1020
1119
 
1120
+ #
1121
+ # Authorization rule for a namespace by name.
1122
+ #
1123
+ # @param resource_group_name [String] Name of the Resource group within the
1124
+ # Azure subscription.
1125
+ # @param namespace_name [String] The Namespace Name
1126
+ # @param authorization_rule_name [String] The authorizationRule name.
1127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1128
+ # will be added to the HTTP request.
1129
+ #
1130
+ # @return [AuthorizationRule] operation results.
1131
+ #
1132
+ def post_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1133
+ response = post_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1134
+ response.body unless response.nil?
1135
+ end
1136
+
1137
+ #
1138
+ # Authorization rule for a namespace by name.
1139
+ #
1140
+ # @param resource_group_name [String] Name of the Resource group within the
1141
+ # Azure subscription.
1142
+ # @param namespace_name [String] The Namespace Name
1143
+ # @param authorization_rule_name [String] The authorizationRule name.
1144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1145
+ # will be added to the HTTP request.
1146
+ #
1147
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1148
+ #
1149
+ def post_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1150
+ post_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
1151
+ end
1152
+
1153
+ #
1154
+ # Authorization rule for a namespace by name.
1155
+ #
1156
+ # @param resource_group_name [String] Name of the Resource group within the
1157
+ # Azure subscription.
1158
+ # @param namespace_name [String] The Namespace Name
1159
+ # @param authorization_rule_name [String] The authorizationRule name.
1160
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1161
+ # to the HTTP request.
1162
+ #
1163
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1164
+ #
1165
+ def post_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
1166
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1167
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1168
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1169
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1170
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1171
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1172
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1173
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
1174
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1175
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1177
+
1178
+
1179
+ request_headers = {}
1180
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1181
+
1182
+ # Set Headers
1183
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1184
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1185
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
1186
+
1187
+ request_url = @base_url || @client.base_url
1188
+
1189
+ options = {
1190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1191
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1192
+ query_params: {'api-version' => @client.api_version},
1193
+ headers: request_headers.merge(custom_headers || {}),
1194
+ base_url: request_url
1195
+ }
1196
+ promise = @client.make_request_async(:post, path_template, options)
1197
+
1198
+ promise = promise.then do |result|
1199
+ http_response = result.response
1200
+ status_code = http_response.status
1201
+ response_content = http_response.body
1202
+ unless status_code == 200
1203
+ error_model = JSON.load(response_content)
1204
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1205
+ end
1206
+
1207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1208
+ # Deserialize Response
1209
+ if status_code == 200
1210
+ begin
1211
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1212
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRule.mapper()
1213
+ result.body = @client.deserialize(result_mapper, parsed_response)
1214
+ rescue Exception => e
1215
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1216
+ end
1217
+ end
1218
+
1219
+ result
1220
+ end
1221
+
1222
+ promise.execute
1223
+ end
1224
+
1021
1225
  #
1022
1226
  # Primary and Secondary ConnectionStrings to the namespace
1023
1227
  #
@@ -1713,6 +1917,94 @@ module Azure::Relay::Mgmt::V2016_07_01
1713
1917
  promise.execute
1714
1918
  end
1715
1919
 
1920
+ #
1921
+ # Authorization rules for a namespace.
1922
+ #
1923
+ # @param next_page_link [String] The NextLink from the previous successful call
1924
+ # to List operation.
1925
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1926
+ # will be added to the HTTP request.
1927
+ #
1928
+ # @return [AuthorizationRuleListResult] operation results.
1929
+ #
1930
+ def list_post_authorization_rules_next(next_page_link, custom_headers:nil)
1931
+ response = list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1932
+ response.body unless response.nil?
1933
+ end
1934
+
1935
+ #
1936
+ # Authorization rules for a namespace.
1937
+ #
1938
+ # @param next_page_link [String] The NextLink from the previous successful call
1939
+ # to List operation.
1940
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1941
+ # will be added to the HTTP request.
1942
+ #
1943
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1944
+ #
1945
+ def list_post_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1946
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1947
+ end
1948
+
1949
+ #
1950
+ # Authorization rules for a namespace.
1951
+ #
1952
+ # @param next_page_link [String] The NextLink from the previous successful call
1953
+ # to List operation.
1954
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1955
+ # to the HTTP request.
1956
+ #
1957
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1958
+ #
1959
+ def list_post_authorization_rules_next_async(next_page_link, custom_headers:nil)
1960
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1961
+
1962
+
1963
+ request_headers = {}
1964
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1965
+
1966
+ # Set Headers
1967
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1968
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1969
+ path_template = '{nextLink}'
1970
+
1971
+ request_url = @base_url || @client.base_url
1972
+
1973
+ options = {
1974
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1975
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1976
+ headers: request_headers.merge(custom_headers || {}),
1977
+ base_url: request_url
1978
+ }
1979
+ promise = @client.make_request_async(:post, path_template, options)
1980
+
1981
+ promise = promise.then do |result|
1982
+ http_response = result.response
1983
+ status_code = http_response.status
1984
+ response_content = http_response.body
1985
+ unless status_code == 200
1986
+ error_model = JSON.load(response_content)
1987
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1988
+ end
1989
+
1990
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1991
+ # Deserialize Response
1992
+ if status_code == 200
1993
+ begin
1994
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1995
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
1996
+ result.body = @client.deserialize(result_mapper, parsed_response)
1997
+ rescue Exception => e
1998
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1999
+ end
2000
+ end
2001
+
2002
+ result
2003
+ end
2004
+
2005
+ promise.execute
2006
+ end
2007
+
1716
2008
  #
1717
2009
  # Lists all the available namespaces within the subscription irrespective of
1718
2010
  # the resourceGroups.
@@ -1779,5 +2071,28 @@ module Azure::Relay::Mgmt::V2016_07_01
1779
2071
  end
1780
2072
  end
1781
2073
 
2074
+ #
2075
+ # Authorization rules for a namespace.
2076
+ #
2077
+ # @param resource_group_name [String] Name of the Resource group within the
2078
+ # Azure subscription.
2079
+ # @param namespace_name [String] The Namespace Name
2080
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2081
+ # will be added to the HTTP request.
2082
+ #
2083
+ # @return [AuthorizationRuleListResult] which provide lazy access to pages of
2084
+ # the response.
2085
+ #
2086
+ def list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
2087
+ response = list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
2088
+ unless response.nil?
2089
+ page = response.body
2090
+ page.next_method = Proc.new do |next_page_link|
2091
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
2092
+ end
2093
+ page
2094
+ end
2095
+ end
2096
+
1782
2097
  end
1783
2098
  end
@@ -25,15 +25,16 @@ module Azure::Relay::Mgmt::V2016_07_01
25
25
  # @return [String] Client Api Version.
26
26
  attr_reader :api_version
27
27
 
28
- # @return [String] Gets or sets the preferred language for the response.
28
+ # @return [String] The preferred language for the response.
29
29
  attr_accessor :accept_language
30
30
 
31
- # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
- # Running Operations. Default value is 30.
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
33
  attr_accessor :long_running_operation_retry_timeout
34
34
 
35
- # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
- # is generated and included in each request. Default is true.
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
37
38
  attr_accessor :generate_client_request_id
38
39
 
39
40
  # @return [Operations] operations
@@ -137,7 +138,7 @@ module Azure::Relay::Mgmt::V2016_07_01
137
138
  #
138
139
  def add_telemetry
139
140
  sdk_information = 'azure_mgmt_relay'
140
- sdk_information = "#{sdk_information}/0.16.0"
141
+ sdk_information = "#{sdk_information}/0.17.0"
141
142
  add_user_agent_information(sdk_information)
142
143
  end
143
144
  end
@@ -541,6 +541,111 @@ module Azure::Relay::Mgmt::V2016_07_01
541
541
  promise.execute
542
542
  end
543
543
 
544
+ #
545
+ # Authorization rules for a WCFRelays.
546
+ #
547
+ # @param resource_group_name [String] Name of the Resource group within the
548
+ # Azure subscription.
549
+ # @param namespace_name [String] The Namespace Name
550
+ # @param relay_name [String] The relay name
551
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
+ # will be added to the HTTP request.
553
+ #
554
+ # @return [Array<AuthorizationRule>] operation results.
555
+ #
556
+ def list_post_authorization_rules(resource_group_name, namespace_name, relay_name, custom_headers:nil)
557
+ first_page = list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, relay_name, custom_headers:custom_headers)
558
+ first_page.get_all_items
559
+ end
560
+
561
+ #
562
+ # Authorization rules for a WCFRelays.
563
+ #
564
+ # @param resource_group_name [String] Name of the Resource group within the
565
+ # Azure subscription.
566
+ # @param namespace_name [String] The Namespace Name
567
+ # @param relay_name [String] The relay name
568
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
569
+ # will be added to the HTTP request.
570
+ #
571
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
572
+ #
573
+ def list_post_authorization_rules_with_http_info(resource_group_name, namespace_name, relay_name, custom_headers:nil)
574
+ list_post_authorization_rules_async(resource_group_name, namespace_name, relay_name, custom_headers:custom_headers).value!
575
+ end
576
+
577
+ #
578
+ # Authorization rules for a WCFRelays.
579
+ #
580
+ # @param resource_group_name [String] Name of the Resource group within the
581
+ # Azure subscription.
582
+ # @param namespace_name [String] The Namespace Name
583
+ # @param relay_name [String] The relay name
584
+ # @param [Hash{String => String}] A hash of custom headers that will be added
585
+ # to the HTTP request.
586
+ #
587
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
588
+ #
589
+ def list_post_authorization_rules_async(resource_group_name, namespace_name, relay_name, custom_headers:nil)
590
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
591
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
592
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
593
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
594
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
595
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
596
+ fail ArgumentError, 'relay_name is nil' if relay_name.nil?
597
+ fail ArgumentError, "'relay_name' should satisfy the constraint - 'MaxLength': '50'" if !relay_name.nil? && relay_name.length > 50
598
+ fail ArgumentError, "'relay_name' should satisfy the constraint - 'MinLength': '1'" if !relay_name.nil? && relay_name.length < 1
599
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
600
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
601
+
602
+
603
+ request_headers = {}
604
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
605
+
606
+ # Set Headers
607
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
608
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
609
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/WcfRelays/{relayName}/authorizationRules'
610
+
611
+ request_url = @base_url || @client.base_url
612
+
613
+ options = {
614
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
615
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
616
+ query_params: {'api-version' => @client.api_version},
617
+ headers: request_headers.merge(custom_headers || {}),
618
+ base_url: request_url
619
+ }
620
+ promise = @client.make_request_async(:post, path_template, options)
621
+
622
+ promise = promise.then do |result|
623
+ http_response = result.response
624
+ status_code = http_response.status
625
+ response_content = http_response.body
626
+ unless status_code == 200
627
+ error_model = JSON.load(response_content)
628
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
629
+ end
630
+
631
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
632
+ # Deserialize Response
633
+ if status_code == 200
634
+ begin
635
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
636
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
637
+ result.body = @client.deserialize(result_mapper, parsed_response)
638
+ rescue Exception => e
639
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
640
+ end
641
+ end
642
+
643
+ result
644
+ end
645
+
646
+ promise.execute
647
+ end
648
+
544
649
  #
545
650
  # Creates or Updates an authorization rule for a WCFRelays
546
651
  #
@@ -874,6 +979,117 @@ module Azure::Relay::Mgmt::V2016_07_01
874
979
  promise.execute
875
980
  end
876
981
 
982
+ #
983
+ # Get authorizationRule for a WCFRelays by name.
984
+ #
985
+ # @param resource_group_name [String] Name of the Resource group within the
986
+ # Azure subscription.
987
+ # @param namespace_name [String] The Namespace Name
988
+ # @param relay_name [String] The relay name
989
+ # @param authorization_rule_name [String] The authorizationRule name.
990
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
991
+ # will be added to the HTTP request.
992
+ #
993
+ # @return [AuthorizationRule] operation results.
994
+ #
995
+ def post_authorization_rule(resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers:nil)
996
+ response = post_authorization_rule_async(resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers:custom_headers).value!
997
+ response.body unless response.nil?
998
+ end
999
+
1000
+ #
1001
+ # Get authorizationRule for a WCFRelays by name.
1002
+ #
1003
+ # @param resource_group_name [String] Name of the Resource group within the
1004
+ # Azure subscription.
1005
+ # @param namespace_name [String] The Namespace Name
1006
+ # @param relay_name [String] The relay name
1007
+ # @param authorization_rule_name [String] The authorizationRule name.
1008
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1009
+ # will be added to the HTTP request.
1010
+ #
1011
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1012
+ #
1013
+ def post_authorization_rule_with_http_info(resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers:nil)
1014
+ post_authorization_rule_async(resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers:custom_headers).value!
1015
+ end
1016
+
1017
+ #
1018
+ # Get authorizationRule for a WCFRelays by name.
1019
+ #
1020
+ # @param resource_group_name [String] Name of the Resource group within the
1021
+ # Azure subscription.
1022
+ # @param namespace_name [String] The Namespace Name
1023
+ # @param relay_name [String] The relay name
1024
+ # @param authorization_rule_name [String] The authorizationRule name.
1025
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1026
+ # to the HTTP request.
1027
+ #
1028
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1029
+ #
1030
+ def post_authorization_rule_async(resource_group_name, namespace_name, relay_name, authorization_rule_name, custom_headers:nil)
1031
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1032
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1033
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1034
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1035
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1036
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1037
+ fail ArgumentError, 'relay_name is nil' if relay_name.nil?
1038
+ fail ArgumentError, "'relay_name' should satisfy the constraint - 'MaxLength': '50'" if !relay_name.nil? && relay_name.length > 50
1039
+ fail ArgumentError, "'relay_name' should satisfy the constraint - 'MinLength': '1'" if !relay_name.nil? && relay_name.length < 1
1040
+ fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
1041
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MaxLength': '50'" if !authorization_rule_name.nil? && authorization_rule_name.length > 50
1042
+ fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
1043
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1044
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1045
+
1046
+
1047
+ request_headers = {}
1048
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1049
+
1050
+ # Set Headers
1051
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1052
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1053
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/WcfRelays/{relayName}/authorizationRules/{authorizationRuleName}'
1054
+
1055
+ request_url = @base_url || @client.base_url
1056
+
1057
+ options = {
1058
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1059
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'relayName' => relay_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
1060
+ query_params: {'api-version' => @client.api_version},
1061
+ headers: request_headers.merge(custom_headers || {}),
1062
+ base_url: request_url
1063
+ }
1064
+ promise = @client.make_request_async(:post, path_template, options)
1065
+
1066
+ promise = promise.then do |result|
1067
+ http_response = result.response
1068
+ status_code = http_response.status
1069
+ response_content = http_response.body
1070
+ unless status_code == 200
1071
+ error_model = JSON.load(response_content)
1072
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1073
+ end
1074
+
1075
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1076
+ # Deserialize Response
1077
+ if status_code == 200
1078
+ begin
1079
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1080
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRule.mapper()
1081
+ result.body = @client.deserialize(result_mapper, parsed_response)
1082
+ rescue Exception => e
1083
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1084
+ end
1085
+ end
1086
+
1087
+ result
1088
+ end
1089
+
1090
+ promise.execute
1091
+ end
1092
+
877
1093
  #
878
1094
  # Primary and Secondary ConnectionStrings to the WCFRelays.
879
1095
  #
@@ -1286,6 +1502,94 @@ module Azure::Relay::Mgmt::V2016_07_01
1286
1502
  promise.execute
1287
1503
  end
1288
1504
 
1505
+ #
1506
+ # Authorization rules for a WCFRelays.
1507
+ #
1508
+ # @param next_page_link [String] The NextLink from the previous successful call
1509
+ # to List operation.
1510
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1511
+ # will be added to the HTTP request.
1512
+ #
1513
+ # @return [AuthorizationRuleListResult] operation results.
1514
+ #
1515
+ def list_post_authorization_rules_next(next_page_link, custom_headers:nil)
1516
+ response = list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1517
+ response.body unless response.nil?
1518
+ end
1519
+
1520
+ #
1521
+ # Authorization rules for a WCFRelays.
1522
+ #
1523
+ # @param next_page_link [String] The NextLink from the previous successful call
1524
+ # to List operation.
1525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1526
+ # will be added to the HTTP request.
1527
+ #
1528
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1529
+ #
1530
+ def list_post_authorization_rules_next_with_http_info(next_page_link, custom_headers:nil)
1531
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers).value!
1532
+ end
1533
+
1534
+ #
1535
+ # Authorization rules for a WCFRelays.
1536
+ #
1537
+ # @param next_page_link [String] The NextLink from the previous successful call
1538
+ # to List operation.
1539
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1540
+ # to the HTTP request.
1541
+ #
1542
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1543
+ #
1544
+ def list_post_authorization_rules_next_async(next_page_link, custom_headers:nil)
1545
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1546
+
1547
+
1548
+ request_headers = {}
1549
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1550
+
1551
+ # Set Headers
1552
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1553
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1554
+ path_template = '{nextLink}'
1555
+
1556
+ request_url = @base_url || @client.base_url
1557
+
1558
+ options = {
1559
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1560
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1561
+ headers: request_headers.merge(custom_headers || {}),
1562
+ base_url: request_url
1563
+ }
1564
+ promise = @client.make_request_async(:post, path_template, options)
1565
+
1566
+ promise = promise.then do |result|
1567
+ http_response = result.response
1568
+ status_code = http_response.status
1569
+ response_content = http_response.body
1570
+ unless status_code == 200
1571
+ error_model = JSON.load(response_content)
1572
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1573
+ end
1574
+
1575
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1576
+ # Deserialize Response
1577
+ if status_code == 200
1578
+ begin
1579
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1580
+ result_mapper = Azure::Relay::Mgmt::V2016_07_01::Models::AuthorizationRuleListResult.mapper()
1581
+ result.body = @client.deserialize(result_mapper, parsed_response)
1582
+ rescue Exception => e
1583
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1584
+ end
1585
+ end
1586
+
1587
+ result
1588
+ end
1589
+
1590
+ promise.execute
1591
+ end
1592
+
1289
1593
  #
1290
1594
  # Lists the WCFRelays within the namespace.
1291
1595
  #
@@ -1333,5 +1637,29 @@ module Azure::Relay::Mgmt::V2016_07_01
1333
1637
  end
1334
1638
  end
1335
1639
 
1640
+ #
1641
+ # Authorization rules for a WCFRelays.
1642
+ #
1643
+ # @param resource_group_name [String] Name of the Resource group within the
1644
+ # Azure subscription.
1645
+ # @param namespace_name [String] The Namespace Name
1646
+ # @param relay_name [String] The relay name
1647
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1648
+ # will be added to the HTTP request.
1649
+ #
1650
+ # @return [AuthorizationRuleListResult] which provide lazy access to pages of
1651
+ # the response.
1652
+ #
1653
+ def list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, relay_name, custom_headers:nil)
1654
+ response = list_post_authorization_rules_async(resource_group_name, namespace_name, relay_name, custom_headers:custom_headers).value!
1655
+ unless response.nil?
1656
+ page = response.body
1657
+ page.next_method = Proc.new do |next_page_link|
1658
+ list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
1659
+ end
1660
+ page
1661
+ end
1662
+ end
1663
+
1336
1664
  end
1337
1665
  end
@@ -25,15 +25,16 @@ module Azure::Relay::Mgmt::V2017_04_01
25
25
  # @return [String] Client API version.
26
26
  attr_reader :api_version
27
27
 
28
- # @return [String] Gets or sets the preferred language for the response.
28
+ # @return [String] The preferred language for the response.
29
29
  attr_accessor :accept_language
30
30
 
31
- # @return [Integer] Gets or sets the retry timeout in seconds for Long
32
- # Running Operations. Default value is 30.
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
33
  attr_accessor :long_running_operation_retry_timeout
34
34
 
35
- # @return [Boolean] When set to true a unique x-ms-client-request-id value
36
- # is generated and included in each request. Default is true.
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
37
38
  attr_accessor :generate_client_request_id
38
39
 
39
40
  # @return [Operations] operations
@@ -137,7 +138,7 @@ module Azure::Relay::Mgmt::V2017_04_01
137
138
  #
138
139
  def add_telemetry
139
140
  sdk_information = 'azure_mgmt_relay'
140
- sdk_information = "#{sdk_information}/0.16.0"
141
+ sdk_information = "#{sdk_information}/0.17.0"
141
142
  add_user_agent_information(sdk_information)
142
143
  end
143
144
  end
@@ -2,6 +2,6 @@
2
2
  # Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
- require '2016-07-01/generated/azure_mgmt_relay'
6
5
  require '2017-04-01/generated/azure_mgmt_relay'
6
+ require '2016-07-01/generated/azure_mgmt_relay'
7
7
  require 'profiles/latest/relay_latest_profile_client'
@@ -3,5 +3,5 @@
3
3
  # Licensed under the MIT License. See License.txt in the project root for license information.
4
4
 
5
5
  module Azure::Relay::Mgmt
6
- VERSION = '0.16.0'
6
+ VERSION = '0.17.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure_mgmt_relay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Microsoft Corporation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-12 00:00:00.000000000 Z
11
+ date: 2018-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.10.0
75
+ version: 0.11.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.10.0
82
+ version: 0.11.0
83
83
  description: Microsoft Azure Relay Library for Ruby
84
84
  email: azrubyteam@microsoft.com
85
85
  executables: []
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  requirements: []
185
185
  rubyforge_project:
186
- rubygems_version: 2.6.10
186
+ rubygems_version: 2.5.1
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Official Ruby client library to consume Microsoft Azure Relay.