// This is an automatically generated code sample. 
// To make this code sample work in your Oracle Cloud tenancy, 
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and 
// boolean, number, and enum parameters with values not fitting your use case).

import * as loadbalancer from "oci-loadbalancer";
import common = require("oci-common");

// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
    try {
     // Create a service client
     const client = new loadbalancer.LoadBalancerClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  createLoadBalancerDetails = {
		compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
		displayName: "EXAMPLE-displayName-Value",
		shapeName: "EXAMPLE-shapeName-Value",
		shapeDetails: {
			minimumBandwidthInMbps: 4646,
			maximumBandwidthInMbps: 961,

			}
,
		isPrivate: false,
		isDeleteProtectionEnabled: false,
		ipMode: loadbalancer.models.CreateLoadBalancerDetails.IpMode.Ipv4,
		ipv6SubnetCidr: "EXAMPLE-ipv6SubnetCidr-Value",
		isRequestIdEnabled: true,
		requestIdHeader: "EXAMPLE-requestIdHeader-Value",
		reservedIps: [{
				id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",

				}
				],
		listeners: {
			EXAMPLE_KEY_QkRX9 :{
				defaultBackendSetName: "EXAMPLE-defaultBackendSetName-Value",
				port: 55557,
				protocol: "EXAMPLE-protocol-Value",
				hostnameNames: ["EXAMPLE--Value"						],
				pathRouteSetName: "EXAMPLE-pathRouteSetName-Value",
				sslConfiguration: {
					verifyDepth: 731,
					verifyPeerCertificate: true,
					hasSessionResumption: true,
					trustedCertificateAuthorityIds: ["EXAMPLE--Value"							],
					certificateIds: ["EXAMPLE--Value"							],
					certificateName: "EXAMPLE-certificateName-Value",
					protocols: ["EXAMPLE--Value"							],
					cipherSuiteName: "EXAMPLE-cipherSuiteName-Value",
					serverOrderPreference: loadbalancer.models.SSLConfigurationDetails.ServerOrderPreference.Disabled,

					}
,
				connectionConfiguration: {
					idleTimeout: 303,
					backendTcpProxyProtocolVersion: 1,
					backendTcpProxyProtocolOptions: [loadbalancer.models.ConnectionConfiguration.BackendTcpProxyProtocolOptions.Pp2TypeAuthority							],

					}
,
				routingPolicyName: "EXAMPLE-routingPolicyName-Value",
				ruleSetNames: ["EXAMPLE--Value"						],

				}

			},
		hostnames: {
			EXAMPLE_KEY_cYidy :{
				name: "EXAMPLE-name-Value",
				hostname: "EXAMPLE-hostname-Value",

				}

			},
		backendSets: {
			EXAMPLE_KEY_5S0b4 :{
				policy: "EXAMPLE-policy-Value",
				backends: [{
						ipAddress: "EXAMPLE-ipAddress-Value",
						port: 42489,
						weight: 935,
						maxConnections: 65418,
						backup: true,
						drain: true,
						offline: false,

						}
						],
				backendMaxConnections: 9664,
				healthChecker: {
					protocol: "EXAMPLE-protocol-Value",
					urlPath: "EXAMPLE-urlPath-Value",
					port: 1744,
					returnCode: 260,
					retries: 889,
					timeoutInMillis: 72102,
					intervalInMillis: 16965,
					responseBodyRegex: "EXAMPLE-responseBodyRegex-Value",
					isForcePlainText: false,

					}
,
				sslConfiguration: {
					verifyDepth: 599,
					verifyPeerCertificate: false,
					hasSessionResumption: true,
					trustedCertificateAuthorityIds: ["EXAMPLE--Value"							],
					certificateIds: ["EXAMPLE--Value"							],
					certificateName: "EXAMPLE-certificateName-Value",
					protocols: ["EXAMPLE--Value"							],
					cipherSuiteName: "EXAMPLE-cipherSuiteName-Value",
					serverOrderPreference: loadbalancer.models.SSLConfigurationDetails.ServerOrderPreference.Enabled,

					}
,
				sessionPersistenceConfiguration: {
					cookieName: "EXAMPLE-cookieName-Value",
					disableFallback: true,

					}
,
				lbCookieSessionPersistenceConfiguration: {
					cookieName: "EXAMPLE-cookieName-Value",
					disableFallback: false,
					domain: "EXAMPLE-domain-Value",
					path: "EXAMPLE-path-Value",
					maxAgeInSeconds: 456,
					isSecure: false,
					isHttpOnly: false,

					}
,

				}

			},
		networkSecurityGroupIds: ["EXAMPLE--Value"				],
		subnetIds: ["EXAMPLE--Value"				],
		certificates: {
			EXAMPLE_KEY_5hkkd :{
				passphrase: "EXAMPLE-passphrase-Value",
				privateKey: "EXAMPLE-privateKey-Value",
				publicCertificate: "EXAMPLE-publicCertificate-Value",
				caCertificate: "EXAMPLE-caCertificate-Value",
				certificateName: "EXAMPLE-certificateName-Value",

				}

			},
		sslCipherSuites: {
			EXAMPLE_KEY_QHKeu :{
				name: "EXAMPLE-name-Value",
				ciphers: ["EXAMPLE--Value"						],

				}

			},
		pathRouteSets: {
			EXAMPLE_KEY_clsmf :{
				pathRoutes: [{
						path: "EXAMPLE-path-Value",
						pathMatchType: {
							matchType: loadbalancer.models.PathMatchType.MatchType.SuffixMatch,

							}
,
						backendSetName: "EXAMPLE-backendSetName-Value",

						}
						],

				}

			},
		freeformTags: {
			EXAMPLE_KEY_kdML6 :"EXAMPLE_VALUE_LJtKV3kWGDMEtMKyeBzu"
			},
		definedTags: {
			EXAMPLE_KEY_lmJv1 :{
				EXAMPLE_KEY_w2FJe :"EXAMPLE--Value"
				}
			},
		securityAttributes: {
			EXAMPLE_KEY_YUKwl :{
				EXAMPLE_KEY_8j9ji :"EXAMPLE--Value"
				}
			},
		ruleSets: {
			EXAMPLE_KEY_oclo4 :{
				items: [{
						action: "ADD_HTTP_REQUEST_HEADER",						header: "EXAMPLE-header-Value",
						value: "EXAMPLE-value-Value"

						}
						],

				}

			},

		}

	const createLoadBalancerRequest: loadbalancer.requests.CreateLoadBalancerRequest = { 
	createLoadBalancerDetails: createLoadBalancerDetails,
	opcRequestId: "NSXCZGFWJXGONBG5ZEH6<unique_ID>",
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",

		}; 


     // Send request to the Client.
     const createLoadBalancerResponse = await client.createLoadBalancer(createLoadBalancerRequest);
     }
     catch (error) {
         console.log("createLoadBalancer Failed with error  " + error);
     }
})();